Generate Desktop shortcuts and Activity shortcuts for activity

Source: Internet
Author: User

Generate Desktop shortcuts and Activity shortcuts for activity

Sometimes, if you want your application to create multiple shortcuts on the desktop, you can declare the corresponding activity in the Manifest. xml file.

<application        android:icon="@drawable/icon"        android:label="@string/app_name"        android:theme="@android:style/Theme.Light" >        <activity            android:name=".PullToRefreshListActivity"            android:label="PtR ListView" >            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>        <activity            android:name=".PullToRefreshGridActivity"            android:label="PtR GridView" >            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>        <activity            android:name=".PullToRefreshExpandableListActivity"            android:label="PtR ExpandableListView" >            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>        <activity            android:name=".PullToRefreshWebViewActivity"            android:label="PtR WebView" >            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>    </application>

The code above is shown in the demo of PullToRefresh, because after the general application is installed, only one shortcut is generated, but four shortcuts are generated for this application, manifest. xml only discovers this thing. It may be useful to record 1.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.