Programing

"실행기 활동이 없습니다!"라는 의미는 무엇입니까?

crosscheck 2020. 9. 23. 07:13
반응형

"실행기 활동이 없습니다!"라는 의미는 무엇입니까?


저는 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!

다음은 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>

단일 인 텐트 필터 태그의 여러 작업 태그도 동일한 오류를 발생시킵니다.


Gusdor가 위에서 말한 것처럼 "단일 인 텐트 필터 태그에있는 여러 작업 태그도 동일한 오류를 발생시킵니다." (그에게 신용을 줘! 그냥 구스 도르에게 키스 할 수있어!)
이 사실에 대한 문서를 찾지 못했습니다! 나는 새로운 (USB) 액션을 추가했고 영리하기 때문에 동일한 인 텐트 필터에 집중시켰다. 그리고 그것은 발사를 깨뜨 렸습니다. Gusdor가 말했듯이 하나의 인 텐트 필터, 하나의 작업! 분명히 각 작업은 자체 인 텐트 필터로 이동해야합니다.
다음과 같이 보일 것입니다 ...

<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>

내가 이것을했을 때, WAZOO! 작동했습니다!


애플리케이션이 시작될 때 시작된 활동으로 설정된 활동이 있습니까?

이것은 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>

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>

런처에서 앱이 열릴 때 Android 용 활동이 기본값으로 실행되도록 지정하지 않았 음을 의미합니다. 앱이 시작될 때 기본값으로 작동 할 활동에 대한 인 텐트 필터를 매니페스트에 추가해야합니다.

자세한 내용은 http://developer.android.com/guide/topics/intents/intents-filters.html#ccases읽어 보세요.


응용 프로그램 태그에 활동 블록을 추가하여 문제를 해결했습니다. 마법사를 사용하여 프로젝트를 만들었는데 왜 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>

그리고 에뮬레이터에서 원하는 출력을 얻습니다.


지적했듯이이 오류는 누락되거나 잘못된으로 인해 발생할 수 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).


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.


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:

enter image description here


In Eclipse when can do this:

enter image description here

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


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

<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

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

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

<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..


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

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

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

Application Nodes section should look like this:


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

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>
            <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>

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

참고URL : https://stackoverflow.com/questions/4801371/what-does-it-mean-no-launcher-activity-found

반응형