zoukankan      html  css  js  c++  java
  • 为Activity生成桌面快捷方式

    有时候如果想让我们的应用在桌面上创建多个快捷方式,我们可以在Manifest.xml文件中对相应的activity进行声明。

    <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>

    代码如上,这是从PullToRefresh的demo中看到的,因为我们一般的应用安装完成后,都只会生成一个快捷方式,但是这个应用却生成了四个,查看了Manifest.xml才发现这个东西,记录①下,可能会有用。

  • 相关阅读:
    矩阵微分
    Installing a single-server IBM FileNet P8 Platform system with IBM Content Navigator
    Linux创建LVM
    tomcat 集群配置,Session复制共享
    JBoss JMX登录需要用户名密码的解决办法
    JBOss启动只能在本机访问的解决办法
    SSH由WAS/Tomcat/Weblogic迁移到JBOSS
    Log4J实用配置指南
    Graphical installers are not supported by the vm
    在vim中执行外部命令
  • 原文地址:https://www.cnblogs.com/magics/p/4213287.html
Copyright © 2011-2022 走看看