這是什么意思“找不到啟動器活動!”

[英]What does it mean “No Launcher activity found!”


I am writing a simple program of Android, and getting these no errors, I don't know what they are. My program is right, but showing not output. I think it is because of these two lines:

我正在編寫一個簡單的Android程序,並且沒有錯誤,我不知道它們是什么。我的程序是正確的,但顯示不輸出。我認為這是因為這兩行:

[2005-01-06 19:56:38 - my_Android] No Launcher activity found!
[2005-01-06 19:56:38 - my_Android] The launch will only sync the application package on the device!

17 个解决方案

#1


154  

Here's an example from AndroidManifest.xml. You need to specify the MAIN and LAUNCHER in the intent filter for the activity you want to start on launch

這是AndroidManifest.xml的一個例子。您需要在意圖過濾器中為要在啟動時啟動的活動指定MAIN和LAUNCHER

<application android:label="@string/app_name" android:icon="@drawable/icon">
    <activity android:name="ExampleActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

#2


51  

Multiple action tags in a single intent-filter tag will also cause the same error.

單個intent-filter標記中的多個操作標記也會導致相同的錯誤。

#3


23  

Like Gusdor said above, "Multiple action tags in a single intent-filter tag will also cause the same error." (Give him the credit! I could just kiss Gusdor for this!)
I didn't find any docs for this fact! I had added a new (USB) action and being clever, I lumped it in the same intent-filter. And it broke the launch. Like Gusdor said, one intent filter, one action! Apparently each action should go in its own intent filter.
It should look like this...

就像Gusdor上面所說的那樣,“單個intent-filter標簽中的多個動作標簽也會導致同樣的錯誤。” (給他信任!我可以親吻Gusdor!)我沒有找到任何關於這個事實的文檔!我添加了一個新的(USB)動作並且很聰明,我將它集中在同一個intent-filter中。它打破了發射。就像古斯多說的那樣,一個意圖過濾器,一個動作!顯然,每個動作都應該在自己的意圖過濾器中。看起來應該是......

<intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
  <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>

When I did this, WAZOO! it worked!

當我這樣做的時候,WAZOO!有效!

#4


17  

Do you have an activity set up the be the launched activity when the application starts?

在應用程序啟動時,您是否將活動設置為已啟動的活動?

This is done in your Manifest.xml file, something like:

這是在Manifest.xml文件中完成的,類似於:

    <activity android:name=".Main" android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

#5


8  

Check your manifest.xml. Make sure you have the category LAUNCHER there.

檢查您的manifest.xml。確保你有類別LAUNCHER。

<activity android:name=".myActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />

        </intent-filter>
    </activity>

#6


6  

It means you didn't specify an Activity for Android to launch as the default when the app opens from the launcher. You have to add an Intent Filter in the Manifest for the Activity you would like to act as the default when the app is being launched.

這意味着當應用程序從啟動器打開時,您沒有指定Android的活動作為默認值啟動。您必須在Manifest中添加一個Intent Filter,以便在啟動應用程序時將其作為默認操作。

Read http://developer.android.com/guide/topics/intents/intents-filters.html#ccases for more details.

有關詳細信息,請閱讀http://developer.android.com/guide/topics/intents/intents-filters.html#ccases。

#7


5  

I fixed the problem by adding activity block in the application tag. I created the project using wizard, I don't know why my AdroidManifest.xml file was not containing application block? I added the application block:

我通過在應用程序標記中添加活動塊來解決問題。我使用向導創建了項目,我不知道為什么我的AdroidManifest.xml文件沒有包含應用程序塊?我添加了應用程序塊:

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".ToDoListActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

And I get the desired output on the emulator.

我在模擬器上獲得了所需的輸出。

#8


4  

As has been pointed out, this error is likely caused by a missing or incorrect intent-filter.

正如已經指出的,此錯誤可能是由於意圖過濾器丟失或不正確引起的。

I would just like to add that this error also shows up if you set android:exported="false" on your launcher activity (in the manifest).

我想補充說,如果你在啟動器活動(在清單中)設置android:exported =“false”,這個錯誤也會顯示出來。

#9


2  

I had this same problem and it turns out I had a '\' instead of a '/' in the xml tag. It still gave the same error but just due to a syntax problem.

我有同樣的問題,結果我在xml標簽中有一個'\'而不是'/'。它仍然給出了相同的錯誤,但僅僅是由於語法問題。

#10


2  

If you are using the standard eclipse IDE provided by google for Android development, you can check the "Launcher Activity" check-box while creating a new Activity. Please find below:

如果您使用谷歌為Android開發提供的標准eclipse IDE,您可以在創建新活動時檢查“啟動器活動”復選框。如下請見:

enter image description here

#11


2  

In Eclipse when can do this:

在Eclipse中可以這樣做:

enter image description here

But it is preferable make the corresponding changes inside the Android manifest file.

但最好在Android清單文件中進行相應的更改。

#12


1  

just add this to your aplication tag in AndroidManifest.xml file

只需將其添加到AndroidManifest.xml文件中的aplication標記即可

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

and also edit the uses-sdk tag from android:targetSdkVersion="16" to 17

並編輯android:targetSdkVersion =“16”到17的uses-sdk標簽

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

#13


1  

You missed in specifying the intent filter elements in your manifest file.Manifest file is:

您錯過了在清單文件中指定intent過濾器元素.Manifest文件是:

<application android:label="@string/app_name" android:icon="@drawable/icon">
    <activity android:name="Your Activity Name"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Add and check this correctly. Hope this will help..

正確添加並檢查。希望這會有所幫助..

#14


1  

Manifest is case sensitive, so please compare this lines for any case mismatch especially the word MAIN in:

清單區分大小寫,因此請將此行與任何情況不匹配進行比較,尤其是MAIN中的單詞:

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

#15


1  

You can add launcher to activity in eclipse manifest visual editor:

您可以在eclipse清單可視化編輯器中添加啟動器到活動:

Application Nodes section should look like this:

#16


1  

MAIN will decide the first activity that will used when the application will start. Launcher will add application in the application dashboard.

MAIN將決定應用程序啟動時將使用的第一個活動。 Launcher將在應用程序儀表板中添加應用程序。

If you have them already and you are still getting the error message but maybe its because you might be using more than more category or action in an intent-filter. In an intent filter there can only be one such tag. To add another category, put it in another intent filter, like the following

如果您已經擁有它們並且仍然收到錯誤消息但可能是因為您可能在intent-filter中使用了更多類別或操作。在意圖過濾器中,只能有一個這樣的標簽。要添加其他類別,請將其放入另一個意圖過濾器中,如下所示

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

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

        <!--
             TODO - Add necessary intent filter information so that this
                Activity will accept Intents with the
                action "android.intent.action.VIEW" and with an "http"
                schemed URL
        -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="http" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>

#17


0  

You have not included Launcher intent filter in activity you want to appear first, so it does not know which activity to start when application launches, for this tell the system by including launcher filter intent in manifest.xml

您尚未在要首先顯示的活動中包含Launcher intent過濾器,因此它不知道在應用程序啟動時要啟動哪個活動,因此通過在manifest.xml中包含啟動器過濾器意圖來告訴系統


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2011/01/26/7254f077e2a9b3b68cbfdfdae44c3193.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com