9

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,594
  • 3
  • 28
  • 37
sean
  • 9,088
  • 21
  • 64
  • 79

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,007
  • 8
  • 86
  • 89
7
    <activity android:name="com.kl.android.ReadSMS.ViewSMS" /> 
kevin lynx
  • 785
  • 8
  • 17
7

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

<activity android:name=".ViewSMS"/> 
Jacob Schoen
  • 13,714
  • 15
  • 80
  • 101
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,630
  • 2
  • 10
  • 17