开发者

One application installed, show two entries in launcher

开发者 https://www.devze.com 2023-01-13 17:07 出处:网络
In Android, how to implement the following effect? Install just one application, but in the launcher, there are two entries, and entering each will go to different ui.

In Android, how to implement the following effect?

Install just one application, but in the launcher, there are two entries, and entering each will go to different ui.

Just like go开发者_JAVA技巧ogle map, you can see only one application, but there are map and navigation entries.

Thanks.


You need to add category as android.intent.category.LAUNCHER for both of the activities in AndroidManifest.xml

Example:

 <application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".MyActivity1" android:label="@string/app_name">
        <intent-filter>
             ....
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".MyActivity2" android:label="@string/app_name">
        <intent-filter>
             ....
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>


 </application>
0

精彩评论

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

关注公众号