开发者

An activity is installed as an application

开发者 https://www.devze.com 2023-02-18 05:30 出处:网络
I just finished my project, and im my phone(simulator too), when i transfer the .apk to the SDCARD and install it, i have my main开发者_StackOverflow中文版 app and one activity is installed as an app!

I just finished my project, and im my phone(simulator too), when i transfer the .apk to the SDCARD and install it, i have my main开发者_StackOverflow中文版 app and one activity is installed as an app! Why? Thank you for your response :).


Check your AndroidManifest.xml and make sure there is only one activity with this:

<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

You could have copied&pasted those tags by mistake.


In the androidmanifest.xml you must have put the

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

in both activities

Remove it from the other activity.


In fact, i just removed this line, and the problem is solved!

<action android:name="android.intent.action.MAIN" />

Thank you :).

0

精彩评论

暂无评论...
验证码 换一张
取 消