简体   繁体   中英

How to add more than one Homepage shortcut for android app with different functionality

I am trying to build an Android Application which contains more than one functionality and I want these functionalities to be accesses with one click from home menu in Android. ex. First (shortcut-icon) sends predefined SMS on user click. Second icon sends predefined email . Third and forth etc ... What I know is: it can be achieved through Widgets . But I need it from icons not only widgets is there a way to avoid making multi apps.

Create multiple Activities with unique functionality each. Then list them all in manifest like

<activity
    android:name="your.package.SmsActivity"
    android:label="Send SMS">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

and so on for each app's feature. You should end up with a single application having multiple "entry points".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM