Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to register a new activity in AndroidManifest.xml?

Tags:

android

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?

like image 430
sean Avatar asked Dec 19 '10 06:12

sean


People also ask

How do I add activity to manifest XML?

To declare your activity, open your manifest file and add an <activity> element as a child of the <application> element. For example: <manifest ... > The only required attribute for this element is android:name, which specifies the class name of the activity.

How do I register a new activity in manifest?

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.

How do I change AndroidManifest XML?

Open your Android project and go to <AppProjectFolder>/app/src/main/. Open the app manifest file AndroidManifest. xml and add the following lines to the file as child elements of the <manifest> element. Note: You must include the QUERY_ALL_PACKAGES permission if your app targets Android 11 (API Level 30) or higher.

Which is the valid statement to create the new activity?

Intent intent = new Intent(); intent.


3 Answers

    <activity android:name="com.kl.android.ReadSMS.ViewSMS" /> 
like image 66
kevin lynx Avatar answered Oct 05 '22 01:10

kevin lynx


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.

like image 23
st0le Avatar answered Oct 05 '22 03:10

st0le


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

<activity android:name=".ViewSMS"/> 
like image 34
Walid Avatar answered Oct 05 '22 03:10

Walid