如何在Android清单文件中组织布局?

问题描述 投票:1回答:3

嗨,伙计们,我是Android Studio的新手,我实际上是在一个项目上,我想知道如何组织我的布局,让我解释一下,我有三个布局,我不知道如何按照这个顺序显示第一个,然后是第二个和第三个:-闪屏-主要-主要活动这里是我的Android Manifest文件。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.recipe">
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name=".principal" />
        <activity android:name=".RecipeActivity" />
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".SplashScreen"
            android:theme="@style/Theme.AppCompat.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

我希望我说的很清楚,我知道这很容易做到,但正如我所说,我是新来的,谢谢大家的帮助。

android android-studio android-layout android-manifest
3个回答
0
投票
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.recipe">
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name=".principal" />
        <activity android:name=".RecipeActivity" />
        <activity android:name=".MainActivity">
        </activity>
        <activity
            android:name=".SplashScreen"
            android:theme="@style/Theme.AppCompat.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

把你的清单改成这样。你的应用程序将从闪屏开始。之后,它取决于你想去哪个活动。通过使用 意图 你可以从一个活动到另一个活动。


0
投票

好了,你有 列表图像有一个问题,启动器活动总是作为第一个活动,假设你想在应用程序启动时出现一个闪屏。


0
投票
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.recipe">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <activity android:name=".principal" />
    <activity android:name=".RecipeActivity" />
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".SplashScreen"
        android:theme="@style/Theme.AppCompat.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

其余的意图和应用程序导航是你做的,祝你好运。

© www.soinside.com 2019 - 2024. All rights reserved.