mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 12:03:28 +08:00
CB-3949: Adding code to mitigate broken intents with the application installer
This commit is contained in:
parent
b032dcca16
commit
b83610a653
@ -250,6 +250,19 @@ public class CordovaActivity extends Activity implements CordovaInterface {
|
||||
}
|
||||
}
|
||||
|
||||
//CB-3949: Workaround for weird Android Launcher Bug!
|
||||
private void checkIntents()
|
||||
{
|
||||
Intent intent = getIntent();
|
||||
String intentAction = intent.getAction();
|
||||
if (!isTaskRoot() && intent.hasCategory(Intent.CATEGORY_LAUNCHER) && intentAction != null) {
|
||||
if(intentAction.equals(Intent.ACTION_MAIN)) {
|
||||
Log.d("Cordova", "This isn't the root activity. Clearing it and returning to the root activity.");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Called when the activity is first created.
|
||||
*
|
||||
@ -258,6 +271,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
checkIntents();
|
||||
Config.init(this);
|
||||
LOG.d(TAG, "CordovaActivity.onCreate()");
|
||||
super.onCreate(savedInstanceState);
|
||||
|
Loading…
Reference in New Issue
Block a user