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?
Asked
Active
Viewed 3.1k times
4 Answers
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
-
can't find an "add" button or something. maybe outdated? – transistor Mar 12 '17 at 20:46
-
@transistor, Yeah, this is from 2010. Android was still in its infancy. – st0le Mar 13 '17 at 09:03
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">

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