mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
Activity.startActivityForResult(): use internalCreateActivity helper method
This commit is contained in:
parent
a4c14c9cd1
commit
6be60574aa
1 changed files with 2 additions and 6 deletions
|
@ -321,11 +321,7 @@ public class Activity extends ContextThemeWrapper implements Window.Callback {
|
|||
Slog.i(TAG, "startActivityForResult(" + intent + ", " + requestCode + "," + options + ") called");
|
||||
if (intent.getComponent() != null) {
|
||||
try {
|
||||
Class<? extends Activity> cls = Class.forName(intent.getComponent().getClassName()).asSubclass(Activity.class);
|
||||
Constructor<? extends Activity> constructor = cls.getConstructor();
|
||||
final Activity activity = constructor.newInstance();
|
||||
activity.intent = intent;
|
||||
activity.getWindow().native_window = getWindow().native_window;
|
||||
final Activity activity = internalCreateActivity(intent.getComponent().getClassName(), getWindow().native_window, intent);
|
||||
activity.resultRequestCode = requestCode;
|
||||
activity.resultActivity = this;
|
||||
runOnUiThread(new Runnable() {
|
||||
|
@ -334,7 +330,7 @@ public class Activity extends ContextThemeWrapper implements Window.Callback {
|
|||
nativeStartActivity(activity);
|
||||
}
|
||||
});
|
||||
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
|
||||
} catch (ReflectiveOperationException e) {
|
||||
onActivityResult(requestCode, 0 /*RESULT_CANCELED*/, new Intent());
|
||||
}
|
||||
} else if (FILE_CHOOSER_ACTIONS.contains(intent.getAction())) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue