How to register a new activity in AndroidManifest.xml?

后端 未结 4 1714
伪装坚强ぢ
伪装坚强ぢ 2020-12-03 18:36

I always get an error when I run my created application and based on my research I haven\'t registered my Activity in the manifest. How can I register a new activity in And

相关标签:
4条回答
  • 2020-12-03 18:49

    Assuming you're using Eclipse,

    Goto your Android Manifest, goto the Applications Tab (at the bottom), click on "Add", Choose Activity. On the right, next to Name: Click on Browse, to get a list of available activities, just add it and you're set! :)

    You could right way just edit the Manifest XML aswell. It's upto you.

    0 讨论(0)
  • 2020-12-03 18:54
        <activity android:name="com.kl.android.ReadSMS.ViewSMS" /> 
    
    0 讨论(0)
  • 2020-12-03 18:55

    In Android Studio, Go to AndroidManifest.xml file and use

     <activity android:name="YourPackageName.ClassName">
    

    For example,

    <activity android:name="com.android.favoritetoys.MainActivity">
    

    For More List of activity attributes in AndroidManifest.xml

    0 讨论(0)
  • 2020-12-03 19:04

    just use the class name after '.' like the following

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