my error is
E/AndroidRuntime(11101): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.hellolinear/java.text.Normalizer$Form};
have you declared this activity in your `AndroidManifest.xml`?
but in my manifest code is:
<activity android:name=".Form"
android:label="#string/app_name">
<intent-filter/>
</activity>
can anyone help me?
If non of above works, then
uninstall app from your device
restart eclipse( if you are using it, otherwise other IDE)
clean your project
Check whether the activity is in the root package. Otherwise mention the package path while declaring in manifest file.
<activity
android:name="com.example.smstracking.MainActivity"
>
</activity>
Perhaps you the package name is incorrect? Try specifying the full package name like this:
<activity android:name="com.example.hellolinear.Form"
android:label="#string/app_name">
<intent-filter/>
</activity>
The correct way to this, however, would be to add the package name like this tou your manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hellolinear"
android:versionCode="1"
android:versionName="1.0.0" >
at least one activity must contain with intent filter that contain action as action.MAIN and category as Launcher as per my knowledge.Hope this helps as you haven't provided the intent filter in your manifest.
<activity android:name="your package name.Your Activity Name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Your Package name is not written correctly. Your Code:
<activity
android:name=".Form"
android:label="#string/app_name">
<intent-filter/>
</activity>
Instead of above, write this:
<activity
android:name="your package name.Form" // eg: android:name="com.example.myapp.Form"
android:label="#string/app_name">
<intent-filter/>
</activity>
Related
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>
The following code works well, I often find some sample code to omit, so I change my code as
<service android:name=".MyInternetServer"></service>
but I get an error "The service can't be found".
I guess the package="com.example.enabledisablebroadcastreceiver" and
<service android:name="com.code4reference.enabledisablebroadcastreceiver.MyInternetServer"></service>,
maybe it should be use full name, right?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.enabledisablebroadcastreceiver"
android:versionCode="1"
android:versionName="1.0" >
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.code4reference.enabledisablebroadcastreceiver.EnableDisableBroadcastReceiver"
android:label="#string/title_activity_enable_disable_boradcast_receiver" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Broadcast receiver -->
<receiver android:name="com.code4reference.enabledisablebroadcastreceiver.AlarmManagerBroadcastReceiver" >
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
<service android:name="com.code4reference.enabledisablebroadcastreceiver.MyInternetServer"></service>
</application>
</manifest>
The shorthand "dot" notation in the Manifest file works as described in the documentation:
However, as a shorthand, if the first character of the string is a
period, the string is appended to the application's package name (as
specified by the <manifest> element's package attribute).
So in your case, using:
.MyInternetServer
...is shorthand for:
com.example.enabledisablebroadcastreceiver.MyInternetServer
as that's what's in your <manifest>'s package attribute.
I'm guessing you probably want to update your manifest's package attribute to match the package you're actually using for your project.
Yes give your service a full path, where its actually located with full package name and then check, it will work.
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.
I created multiple packages to better structure our Android-based project. After creating these packages, the application no longer runs. It's a widget application. I noticed that the application manifest needed to be modified and did so. This didn't seem to fix the problem. I don't get any error messages, I'm simply not able to open the main activity page from the application widget. Could anyone tell me how to resolve this issue?
For more detail, I initially had a flat project structure (com.domain.A). Now I have the following:
com.domain.Activities
Activity1.java
Activity2.java
com.domain.Features
Feature1.java
Feature2.java
com.domain.Services
Service_1.java
Service_2.java
etc...
Here's an excerpt from the manifest file:
<activity android:name="com.domain.Activities.Activity1"
android:theme="#style/Theme.D1"
android:label="#string/act1"
/>
<activity android:name="com.domain.Activities.Activity2"
android:theme="#style/Theme.D1"
android:label="#string/act2"
/>
<activity android:name="com.domain.Features.Feature1"
android:theme="#style/Theme.D1"
android:label="#string/fea1"
/>
<activity android:name="com.domain.Features.Feature2"
android:theme="#style/Theme.D1"
android:label="#string/fea2"
/>
<service android:name="com.cmu.Services.Service_1"/>
<service android:name="com.cmu.Services.Service_2"/>
Thanks.
After moving the classes in packages, how have you defined the activities in the manifest.
(as a thumb rule ctrl+click on activity declaration in manifest should take you to class file, else link is broken), its generally better to keep all classes extending Activity in main android package of your app
EDIT:
if your MyActivity lies under package a.b;
then .a.b.MyActivity is to be used for android:name in manifest the dot(.) initially specifies to use package-prefix from manifest package name..
You specify a package in your manifest, then you can just use the . prefix to reference the package for the Activities you define in you manifest. So for example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.domain"
android:versionCode="1"
android:versionName="1.0" >
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:label="#string/app_name"
android:name=".activities.MainActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.Activity1" />
<activity android:name=".activities.Activity2" />
You main launcher activity is thus: com.domain.activities.MainActivity and the other two are: com.domain.activities.Activity1 and com.domain.activities.Activity2
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>