zoukankan      html  css  js  c++  java
  • android 在manifest 中设置 多个Activity时的 默认 根 Activity

    An <activity> element can also specify various intent filters—using the <intent-filter> element—in order to declare how other application components may activate it.

    When you create a new application using the Android SDK tools, the stub activity that's created for you automatically includes an intent filter that declares the activity responds to the "main" action and should be placed in the "launcher" category. The intent filter looks like this:

    <activity android:name=".ExampleActivity" android:icon="@drawable/app_icon">
       
    <intent-filter>
           
    <action android:name="android.intent.action.MAIN" />
           
    <category android:name="android.intent.category.LAUNCHER" />
       
    </intent-filter>
    </activity>

    The <action> element specifies that this is the "main" entry point to the application. The <category> element specifies that this activity should be listed in the system's application launcher (to allow users to launch this activity).

    If you intend for your application to be self-contained and not allow other applications to activate its activities, then you don't need any other intent filters. Only one activity should have the "main" action and "launcher" category, as in the previous example. Activities that you don't want to make available to other applications should have no intent filters and you can start them yourself using explicit intents (as discussed in the following section).

    However, if you want your activity to respond to implicit intents that are delivered from other applications (and your own), then you must define additional intent filters for your activity. For each type of intent to which you want to respond, you must include an <intent-filter> that includes an <action> element and, optionally, a <category> element and/or a <data> element. These elements specify the type of intent to which your activity can respond.

    For more information about how your activities can respond to intents, see the Intents and Intent Filters document.

  • 相关阅读:
    Etcd Web UI
    安装cfssl证书工具
    top命令
    解决k8s Get http://127.0.0.1:10252/healthz: dial tcp 127.0.0.1:10252: connect: connection refused
    k8s集群安装KubeSphere3.0
    k8s基于NFS部署storageclass实现pv并标记为一个默认的StorageClass
    k8s提示Unable to connect to the server: x509
    k8s安装Prometheus+Grafana
    开源日志管理ELK和Graylog区别
    mysql数据库查询结果导出
  • 原文地址:https://www.cnblogs.com/freeliver54/p/2060152.html
Copyright © 2011-2022 走看看