Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top