mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
createMainActivity: prioritize Activities with category DEFAULT
This commit is contained in:
parent
32a7846a9d
commit
4648dd3249
1 changed files with 5 additions and 2 deletions
|
@ -89,15 +89,18 @@ public class Activity extends ContextThemeWrapper implements Window.Callback, La
|
|||
Uri uri = uriString != null ? Uri.parse(uriString) : null;
|
||||
if (className == null) {
|
||||
for (PackageParser.Activity activity: pkg.activities) {
|
||||
boolean isDefault = false;
|
||||
for (PackageParser.IntentInfo intent: activity.intents) {
|
||||
Slog.i(TAG, intent.toString());
|
||||
if ((uri == null && intent.hasCategory("android.intent.category.LAUNCHER")) ||
|
||||
(uri != null && intent.hasDataScheme(uri.getScheme()))) {
|
||||
className = activity.className;
|
||||
break;
|
||||
isDefault = intent.hasCategory("android.intent.category.DEFAULT");
|
||||
if (isDefault)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (className != null)
|
||||
if (isDefault)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue