You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
createMainActivity: prioritize Activities with category DEFAULT
This commit is contained in:
@@ -89,15 +89,18 @@ public class Activity extends ContextThemeWrapper implements Window.Callback, La
|
|||||||
Uri uri = uriString != null ? Uri.parse(uriString) : null;
|
Uri uri = uriString != null ? Uri.parse(uriString) : null;
|
||||||
if (className == null) {
|
if (className == null) {
|
||||||
for (PackageParser.Activity activity: pkg.activities) {
|
for (PackageParser.Activity activity: pkg.activities) {
|
||||||
|
boolean isDefault = false;
|
||||||
for (PackageParser.IntentInfo intent: activity.intents) {
|
for (PackageParser.IntentInfo intent: activity.intents) {
|
||||||
Slog.i(TAG, intent.toString());
|
Slog.i(TAG, intent.toString());
|
||||||
if ((uri == null && intent.hasCategory("android.intent.category.LAUNCHER")) ||
|
if ((uri == null && intent.hasCategory("android.intent.category.LAUNCHER")) ||
|
||||||
(uri != null && intent.hasDataScheme(uri.getScheme()))) {
|
(uri != null && intent.hasDataScheme(uri.getScheme()))) {
|
||||||
className = activity.className;
|
className = activity.className;
|
||||||
break;
|
isDefault = intent.hasCategory("android.intent.category.DEFAULT");
|
||||||
|
if (isDefault)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (className != null)
|
if (isDefault)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user