10

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 AndroidManifest.xml?

Chilledrat
  • 2,593
  • 3
  • 28
  • 38
sean
  • 9,198
  • 22
  • 65
  • 80

4 Answers4

9

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.

st0le
  • 33,375
  • 8
  • 89
  • 89
7
    <activity android:name="com.kl.android.ReadSMS.ViewSMS" /> 
kevin lynx
  • 785
  • 9
  • 17
7

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

<activity android:name=".ViewSMS"/> 
Jacob Schoen
  • 14,034
  • 15
  • 82
  • 102
Walid
  • 91
  • 1
0

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

Aamir Kalimi
  • 1,821
  • 2
  • 15
  • 19