android.content.ActivityNotFoundException:

前端 未结 24 1851
一生所求
一生所求 2020-11-22 10:38

I am getting this exception while I am trying to call an activity from another one. The complete exception is

android.content.ActivityNotFoundExcept

相关标签:
24条回答
  • 2020-11-22 11:28

    In addition to Mina's answer. When you declare activity as inner static class then you should write your activity into manifest like ...

             <activity android:name=".app.FragmentLayoutSupport$DetailsActivity" />
    

    here .app comes from your package name , it can be .helpers.afdfa$afda

    0 讨论(0)
  • 2020-11-22 11:30

    Maybe you need to check that you added the new activity to the manifest.xml file

    Example:

    <activity
          android:name=".className" 
          android:label="@string/app_name" > 
    </activity>
    
    0 讨论(0)
  • 2020-11-22 11:31

    Delete your activity from the manifest and then add it again. This type do not write type the XML directly. Instead, go to Application > Application nodes > add, choose the Activity, and then browse for the file source.

    This worked for me.

    0 讨论(0)
  • 2020-11-22 11:31

    I got the same case too. After reading thepearson's answer, I revised my Activity and found out that I wrote

    public void onCreate(Bundle s)
    

    But in fact it should be

    protected void onCreate(Bundle s)
    

    And it works now!

    0 讨论(0)
  • 2020-11-22 11:32

    Added a new activity and defined it in manifest.xml, but I was still getting "Unable to find explicit activity class" error. I am using Eclipse. Solution for my problem was "cleaning" the project. From the main menu in Eclipse: Project|Clean.... Then you select your project and clean it.

    0 讨论(0)
  • 2020-11-22 11:34

    I had the same issue. I tried everything but the error, which I sorted out later, was that there was a space left between double quotes and my class name. It has to be: intent.setClassName("com.x.y","com.x.y.className")

    not

    intent.setClassName("com.x.y","  com.x.y.className")
    
    0 讨论(0)
提交回复
热议问题