Android: No Launcher activity found! was working b

2019-04-11 23:49发布

I have the same problem everyone reports but this began happening suddenly. My app was working as expected, automatically launching the MAIN activity. But all of the sudden it stopped working and I started seeing the No Launcher activity found! message.

This is my Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xitrica.android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:minSdkVersion="8" />

<application android:icon="@drawable/icon" android:label="@string/app_name"
    android:theme="@style/Theme.Transparent">
    <uses-library android:name="com.google.android.maps" android:required="true" />
    <activity android:name="ElBusetonActivity" android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="andoid.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="RouteInfoActivity"></activity>
    <activity android:theme="@android:style/Theme.Translucent.NoTitleBar"
        android:name="GetDirectionsActivity"></activity>
    <activity android:theme="@android:style/Theme.Dialog"
        android:name="PointProviderList"></activity>
    </application>
</manifest>

Sorry if I'm not posting this snippet correctly. It's the first time I ever post a question.

Thanks in advance.

4条回答
干净又极端
2楼-- · 2019-04-11 23:55

use the dot before the activities in your manifest to declare it. or you can write the package name dot your activity name. like this.........

<activity android:name=".ElBusetonActivity" android:label="@string/app_name">

if you not using package name then it decide the default one.

查看更多
放我归山
3楼-- · 2019-04-11 23:58
<activity android:name=".ElBusetonActivity" android:label="@string/app_name">

try this, prefix (".") on activity name here (.) refer to package path

查看更多
不美不萌又怎样
4楼-- · 2019-04-12 00:09

Remove category android:name="android.intent.category.DEFAULT" as it is not required.

查看更多
Ridiculous、
5楼-- · 2019-04-12 00:17

Say if you have the Activity names TestActivity

If you want the TestActivity to be the first to launch when you hit "run", simply add two lines:

<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

To the position like below in your AndroidManifest.xml:

    <activity
        android:name="TestActivity"
        android:label="@string/name"
        android:screenOrientation="portrait" >
        <intent-filter android:label="@string/app_name" >

            <action android:name="android.intent.action.MAIN" />

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

        </intent-filter>
    </activity>
查看更多
登录 后发表回答