Android Eliminate Complete Action Using dialog

2019-05-24 21:08发布

问题:

I have 2 apps and both integrate a package containing an activity. My problem is that when I launch any one app, and when it calls the activity inside the package, it shows me a dialog:

Complete action using:

App1

App2

I want to eliminate this dialog, so it just launches the activity from its own integrated package.

Currently, my AndroidManifest.xml contains for the package activity:

        <intent-filter>
            <action android:name="com.example.test.TestActivity" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>

Thanks Chris

回答1:

You will need to change the <intent-filter> for one of those two copies of the activity. Right now, both are advertising that they support the same action string. Change one to use a different action string. Or, don't use the action string in the Intent -- use new Intent(this, TestActivity.class) if the Java code is part of your application.