Warning: Exported activity does not require permission - android

I recently created a project and added a splash and a main activity. I edited the manifest file and added the splash activity and the main activity in to it. After adding the main activity, it gives me a warning "Exported Activity Does not Require Permission". What is this warning that it gives me? my API version is android:15.
Please help,
Thank you!
this is my manifest file!
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sliit.droidman"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15" />
<application android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme">
<activity
android:name=".SplashActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="com.sliit.droidman.main.MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.sliit.droidman.main.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>

add this to your activity definition
android:exported="false"

This warning means that your activities are exposed to different-process apps that might instantiate them without any required permission.
for details see:
http://developer.android.com/guide/topics/manifest/activity-element.html
http://developer.android.com/guide/topics/manifest/activity-element.html#prmsn

It could be due to the <action android:name="com.sliit.droidman.main.MAINACTIVITY" />. I don't know why you add that intent filter?
You normally don't need an intent-filter for other normal activities.

Related

No launcher activity found.! The launch will only sync the application package on the device.!

I am facing the problem plzzz help me out. Here is my manifest.xml file.
Plz help me out.......your help is highly appreciated....
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hello.myandroidnew"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.myandroidnew.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".second"/>
</application>
</manifest>
Change your intent filter to the following:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
The difference is the action. It must be android.intent.action.MAIN in order to be listed in the launcher.
You have to set the action name properly so that android know that it is the main activity. Change
<action android:name="android.intent.action.MAINACTIVITY" />
to
<action android:name="android.intent.action.MAIN" />
update:-
You specify name of the class in
<activity
android:name="com.example.myandroidnew.MainActivity"
Docs of "android.intent.action.MAIN" specifies :-
public static final String ACTION_MAIN
Added in API level 1
Activity Action: Start as a main entry point, does not expect to receive data.
Input: nothing
Output: nothing
Constant Value: "android.intent.action.MAIN"
Thus you can see that action.MAIN tells android that it is the main entry point i.e. the default activity that is to be shown when the app starts.

declare intent in manifest file

I have declared a intent to access another layout on a button click, When it was run I getting following error,
android.content.ActivityNotFoundException: Unable to find explicit activity class xxxxxx; have you declared this activity in your AndroidManifest.xml?
From this I understood that intent need to be declared in android manifest file but I don't know how to declare.
Can anyone explain me how to declare<
Thanks in advance
Siva
you need to declare your activity in android manifest.xml here is an example:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".Activity1" android:label="#string/app_name"></activity>
<activity android:name=".Activity2"></activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
u missed some like .helloListView in manifest, even check for the dot.
<activity android:name=".helloListVeiw"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Duplicate attribute error in AndroidMainfest.xml while adding a new Activity

I was making a simple text field and 'send' button to display whatever the user typed in the text field. The program is completely illustrated in the Android training tutorials by android.com.
Whenever I'm adding the Activity DisplayMessageActivity, I'm getting "Duplicate attribute" as an error. Here's the code:
<application
<activity android.name="DroidStart"/>
<activity
android:name="com.start.droidstart.DisplayMessageActivity"
android:label="#string/title_activity_droid" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Update: I fixed the problems that were pointed out, but I'm still getting the error. Here's my current AndroidMainfest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.start.droidstart"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="DroidStart"
android:name="com.start.droidstart.DisplayMessageActivity"
android:label="#string/title_activity_droid" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
The error looks like this
Error parsing XML; duplicate attribute. type Android AAPT problem.
My problem was the tools:replace duplicated.
Fixed easy:
tools:replace="android:label,android:theme">
You have at least two errors:
Be sure to close your <application> tag.
Use android:name, not android.name.
So the first 3 lines should change from:
<application
<activity android.name="DroidStart"/>
to
<application>
<activity android:name="DroidStart"/>
Update:
In your updated code, you have:
<activity
android:name="DroidStart"
android:name="com.start.droidstart.DisplayMessageActivity"
You are using android:name twice, which is why you are getting this error. You should probably change this to:
<activity
android:name=".DisplayMessageActivity"
assuming DisplayMessageActivity is the class name of the Activity you which to refer to.
Last, you forgot your manifest end tag: you should have </manifest> at the very end of your file.
change
android.name
into
android:name
on the first line...
For instantapp project also check that you have
xmlns:android = "http://schemas.android.com/apk/res/android"
in app AndroidManifest.xml in manifest tag.
use
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.start.droidstart"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/title_activity_droid" >
<activity
android:name=".DisplayMessageActivity"
android:label="#string/title_activity_droid" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DroidStart"/>
</application>
</manifest>
instead of
<application
<activity android.name="DroidStart"/>
you are using "android.name" instead of "android:name" for declaring activity in manifest and also close first application tag as <application>

app appears in Manage Applications, but not on the main menu

I'm using Eclipse to make an Android app. I've used it before and not had this problem. The console says everything installed ok, so I'm a little confused. I'm not sure what is relevant from logcat, but I can post it if you think that would help.
I've restarted Eclipse, ADB, the emulator, and the Mac several times in various orders and nothing has helped. I know it must be something simple but I haven't played around with this in a few months.
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hyser.pinpoint"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
</application>
<activity android:name=".pinpoint" android:label="pinpoint">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Your Activity needs to be inside of your application tag in your manifest
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity android:name=".pinpoint" android:label="pinpoint">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
It's a similar issue to this:
Unable to start Service Intent
Your <activity> tag needs to be in the <application> block.
Is it possible your manifest does not refer to any activities? If you install an app with no activities in the manifest you will get this behavior.

Android Package structure

My default package name is com.xont.controller (R file contain that package.Eclipse generated one) . I want to make it more packages.Like 'com.xont.controller.salesand 'com.xont.controller.admin like this: And I added activity also in manifestfile
Edited
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.xont.controller"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:label="Xont" android:icon="#drawable/virtusel64">
<activity android:name=".AndroidAppXontActivity"
android:label="Xont">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity"
android:label="Login">
</activity>
<activity android:name=".syn.DatabaseCheckActivity"
android:label="Databse Setup">
</activity>
...........
Package structure is:
Error says : android.content.ActivityNotFoundException: Unable to find explicit activity class {com.xont.controller/com.xont.controller.syn.DatabaseSetupActivity}; have you declared this activity in your AndroidManifest.xml?
Please help me what i want to do here.
All components that are registered as .SomeName use manifest's package value as prefix. So basicaly you regsitered activity .AndroidAppXontActivity as com.android.xont.controller.AndroidAppXontActivity. But there is no such java class.
You should fix your component names to have full name to your Java class, like this:
<activity android:name="com.xont.controller.AndroidAppXontActivity" ... />
Same for all other components.
Please try this,
<activity android:name="com.xont.controller.syn.DatabaseSetupActivity"
android:label="Databse Setup">
</activity>

Categories

Resources