50 lines
1.9 KiB
Java
50 lines
1.9 KiB
Java
package com.facebook;
|
|
|
|
import android.app.Activity;
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.IntentFilter;
|
|
import android.os.Bundle;
|
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class CustomTabActivity extends Activity {
|
|
public static final String b = CustomTabActivity.class.getSimpleName() + ".action_customTabRedirect";
|
|
public static final String c = CustomTabActivity.class.getSimpleName() + ".action_destroy";
|
|
private BroadcastReceiver a;
|
|
|
|
@Override // android.app.Activity
|
|
protected void onActivityResult(int i, int i2, Intent intent) {
|
|
super.onActivityResult(i, i2, intent);
|
|
if (i2 == 0) {
|
|
Intent intent2 = new Intent(b);
|
|
intent2.putExtra(CustomTabMainActivity.e, getIntent().getDataString());
|
|
LocalBroadcastManager.a(this).a(intent2);
|
|
this.a = new BroadcastReceiver() { // from class: com.facebook.CustomTabActivity.1
|
|
@Override // android.content.BroadcastReceiver
|
|
public void onReceive(Context context, Intent intent3) {
|
|
CustomTabActivity.this.finish();
|
|
}
|
|
};
|
|
LocalBroadcastManager.a(this).a(this.a, new IntentFilter(c));
|
|
}
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
protected void onCreate(Bundle bundle) {
|
|
super.onCreate(bundle);
|
|
Intent intent = new Intent(this, (Class<?>) CustomTabMainActivity.class);
|
|
intent.setAction(b);
|
|
intent.putExtra(CustomTabMainActivity.e, getIntent().getDataString());
|
|
intent.addFlags(603979776);
|
|
startActivityForResult(intent, 2);
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
protected void onDestroy() {
|
|
LocalBroadcastManager.a(this).a(this.a);
|
|
super.onDestroy();
|
|
}
|
|
}
|