androidandroid-launcher

Android app opens app info screen on launch instead of launching main Activity


I am not sure if it is an issue, but this is the first time I ran into it.

I am halfway through developing an app. When I disconnect my app from Android Studio and my PC after some coding stuff, if I try to open my app on my phone, it launches app info screen (screen where we see force stop, clear memory) instead of launching my main activity and I couldn't use the app. And when I relaunch my activity by connecting with Android Studio, it works fine.

I worked on other apps too but did not encounter something like this.

Here is the code from my app manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.meanings_downloader">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"            />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
    android:requestLegacyExternalStorage="true"
    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=".Music_Activity"></activity>
    <activity
        android:name=".SettingsActivity"
        android:label="@string/title_activity_settings" />
    <activity android:name=".settings" />
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
      <action android:name="android.intent.action.SEND" />
            <data android:mimeType="*/*"/>
            <category android:name="android.intent.category.DEFAULT"/>


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

    <service android:name=".Music" >
        <intent-filter>
            <action android:name="android.media.browse.MediaBrowserServic"/>
        </intent-filter>
    </service>
</application>

Is it an issue or am I doing something wrong ?


Solution

  • Your intent filter is set up incorrectly, meaning that it's not matching the filter for a launcher activity. You probably meant to create two different intent filters, i.e.,

            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER"/>
                <action android:name="android.intent.action.MAIN"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND"/>
                <data android:mimeType="image/*"/>
            </intent-filter>