Rumah > Soal Jawab > teks badan
<?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>
Jika dikonfigurasikan dalam Aktiviti
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Adakah ini pintu masuk ke program ini?
ringa_lee2017-05-31 10:39:45
Ya.
///MAIN表示是主入口
<action android:name="android.intent.action.MAIN" />
///LAUNCHER表示桌面显示的icon对应的Activity
<category android:name="android.intent.category.LAUNCHER" />
MAIN dan LAUNCHER boleh ditetapkan kepada berbilang aktiviti pada masa yang sama.
Tetapi MAIN hanya berfungsi pada aktiviti yang diisytiharkan di bahagian atas manifes; PELANCUR berfungsi pada semua aktiviti yang ditetapkan, yang bermaksud anda akan melihat berbilang ikon pada desktop.