问题
So , i want to have an additional Shortcut with another Icon for the same App , this additional Shortcut , Visible in App Drawer , should launch a Simple Activity/Service ,
it is Possible , If yes How ? If Possible , Programmaticly ,
Does its matter with < application > Tag ? ,
Thanks
回答1:
Of course you can have two or more launcher activities in your application. Just set an intent filter with launch attributes.
<activity
android:name=".SecondActivity"
android:icon="@drawable/ic_second_launcher">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
If you want to start a service from the AppDrawer, just call an empty Activty
which starts the Service
in onCreate
来源:https://stackoverflow.com/questions/17907167/two-shortcut-with-two-icons-for-the-same-app