[Android] android.content.ActivityNotFoundException: No Activity found to handle Intent 해결방법
안드로이드로 개발 하던 중에 "android.content.ActivityNotFoundException: No Activity found to handle Intent" 에러가 발생 될 수 있는데, 이번 포스팅에서는 이러한 에러가 발생 될 때 해결 하는 방법에 대해서 알아보도록 하겠습니다.
android.content.ActivityNotFoundException: No Activity found to handle Intent 발생원인
위 에러는 보통 <intent-filter>가 추가된 Activity를 실행하는 과정에서 발생 되는 에러로 에러 문구 그대로 실행할 해당 Activity를 찾을 수 없을때 발생되는 에러 입니다.
실행할 Activity의 이름이 틀리거나 manifest파일에 <intent-filter>가 빠져 있거나 잘못 설정되었을때 발생 되는 에러 입니다.
android.content.ActivityNotFoundException: No Activity found to handle Intent 해결 방법
우선 Activity의 이름이 제대로 작성 되어 있는지 확인 한 후 올바르게 수정 해줍니다. 이름이 정상적이라면 manifest파일에서 실행한 Activity의 <intent-filter>를 확인 해줍니다.
가령 아래와 같이 TestActivity에 <intent-filter>를 설정 할 경우 해당 Activity를 호출 할 경우 <intent-filter>중 android:name으로 설정한 "com.kanzler.test.view" 이름으로 호출 해야 정상적으로 호출 되게 됩니다.
1 2 3 4 5 6 | <activity android:name=".test.TestActivity"> <intent-filter> <action android:name="com.kanzler.test.view" /> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity> | cs |