2

I have this project structure on a test app.

App module -> an API interfaces module -> a dynamic module that implements my API interfaces and used third party APIs.

On the dynamic module I have an Activity defined from a third party. This activity has a check in it to make sure no other app in the entire system has the same scheme registered. Basically to make not two apps are using the same third party API key.

Their code for this check is super simple:

    Intent testIntent = new Intent(Intent.ACTION_VIEW);
    testIntent.setData(Uri.parse("theirscheme://....."));
    PackageManager pm = context.getPackageManager();
    List<ResolveInfo> activities = pm.queryIntentActivities(testIntent, 0);

When using dynamic modules with the code above, activities has a size of 2.

I managed to get activities to have a size of 1 by using Edit configuration on Android Studio and unchecking the dynamic module on the General tab. But then the module wasn't installed so I couldn't access it.

I don't know what will happen once I do use SplitManager to install it, will I once again have a double activity?

My only solution right now has been to put the Activity in the App module manifest and only there but that is not a good permanent solution.

Anyone have any suggestions on how to handle this situation?

Thanks.

Edit: I've tried several Android phones with various versions (6,7,10,11) and only the phones with Android 10 seem to have the issue. So maybe it is an Android 10 issue?

Edit: I have made a simple sample showing the issue: https://github.com/casolorz/doubleactivityissue

I even tested it on the Android 10 emulator. It will display a count of 2 if it has the issue. A count of 1 if it doesn't.

I think this is probably a bug, but I don't know if I should submit it to the bug tracker of Android Studio? Android? Google Play Core Library?

casolorz
  • 8,486
  • 19
  • 93
  • 200

0 Answers0