Heim > Fragen und Antworten > Hauptteil
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ucloud.uvod.example"
android:installLocation="internalOnly" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/BlueTheme" >
<activity
android:name="com.ucloud.uvod.example.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/BlueTheme"
android:screenOrientation="sensor" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ucloud.uvod.example.impl.UEasyPlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="sensor"
android:theme="@style/FullscreenTheme" >
<intent-filter>
<action android:name="ucloud.intent.action.uvod.example.easyplayer" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:scheme="http" />
<data android:scheme="file" />
</intent-filter>
</activity>
<activity
android:name="com.ucloud.uvod.example.impl.UVideoViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="sensor"
android:theme="@style/FullscreenTheme" >
<intent-filter>
<action android:name="ucloud.intent.action.uvod.example.uvideoview" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.ucloud.uvod.example.permission.PermissionsActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:theme="@style/BlueTheme"/>
</application>
</manifest>
Wenn in Aktivität konfiguriert
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Ist das der Eingang zum Programm?
ringa_lee2017-05-31 10:39:45
是的。
///MAIN表示是主入口
<action android:name="android.intent.action.MAIN" />
///LAUNCHER表示桌面显示的icon对应的Activity
<category android:name="android.intent.category.LAUNCHER" />
MAIN 和 LAUNCHER 可以同时设置给多个Activity。
但是 MAIN 只对在manifast里面声明位置最靠上的那个Activity起作用;LAUNCHER 则对所有设置了的Activity起作用,也就是说你在桌面上会看到多个icon。