Android - Activity Not Found Exception

前端 未结 13 1792
春和景丽
春和景丽 2020-11-30 10:05

I am using startActivity to call another Activity and I get the \"Activity Not Found Exception\". Here is my code:

  TextView textView = (TextView) itemClic         


        
相关标签:
13条回答
  • 2020-11-30 10:30

    If your two activities (symptomActivity and symptomRemedyActivity) are in different packages, you have to declare in Android Manifest the package name.

    0 讨论(0)
  • 2020-11-30 10:35

    I had same issue.Deleted bin and lib folder from project directory, recreated libs folder and pasted libs .everything started working. It was v4 lib that was culprit.

    0 讨论(0)
  • 2020-11-30 10:38

    You certainly forgot to declare the activity in the manifest file AndroidManifest.xml as follows (you need to inject the value you actually got):

       <activity
            android:name="symptomRemedyActivity"
            android:label="@string/title_activity_ symptomRemedy"
            android:parentActivityName="MainActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="MainActivity" />
        </activity>
    
    0 讨论(0)
  • 2020-11-30 10:39

    I know this is an old post, but it's on top of the google search at the moment, so for anyone who would come here later: ActivityNotFound can be caused by unhandled exceptions in your onCreate in the activity you're trying to create. It took me a while to notice that I was causing a nullPointerException there, because I wasn't looking for it.

    0 讨论(0)
  • 2020-11-30 10:44

    Did you list the activity (symtomRemedyActivity) within your AndroidManifest.xml file?

    0 讨论(0)
  • 2020-11-30 10:45

    Make sure you have added the following to the Manifest File

        <activity
            android:name=".YourActivity"
            >
        </activity>
    
    0 讨论(0)
提交回复
热议问题