The list view is gone after adding the viewpager


#1

After adding CrimePagerActivity to the manifest, crime#0 was shown instead of a list view that was previously presented when I tried to run the app. Return button would just exit the app. Anyone have an insight on what would go wrong in my situation?


#2

Please share your AndroidManifest.xml and then we can check whether you use the CrimePagerActivity as the LAUNCHER activity.


#3
<?xml version="1.0" encoding="utf-8"?>

<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=".CrimePagerActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
</application>

#4

You should move the intent-filter tag under CrimeListActivity. i.e. Make CrimeListActivity as your launcher activity.

        <activity android:name=".CrimePagerActivity">
        </activity>
        <activity android:name=".CrimeListActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

#5

Am facing the same problem. Hope anyone here can help me too. Thanks in advance.
Regards,
https://akinator.ooo/ https://xender.vip/