Unable to find explicit activity class in manifest for external library - android

I need to add an activity tag for an external library I'm using, per their documentation, but when I do that using this code
<activity
android:name="com.adityaanand.morphdialog.MorphDialogActivity"
android:theme="#style/MorphDialog.Custom.Light">
</activity>
in my application tag, I get the error
Unable to find explicit activity class {com.jggdevelopment.simpleweather/in.adityaanand.morphdialog.MorphDialogActivity}; have you declared this activity in your AndroidManifest.xml?
How can I include an external library's activity in my manifest file?
This is the library.

All I had to do was change the activity name to in.adityaanand.morphdialog.MorphDialogActivity and it worked. I thought I had tried that already, but I guess not.

Related

Start Library module activity

I have a library module and Main module and I try to start the activity that is defined in library module from other android application. I tried many ways but I didn't succeed. I tried to...
set Component name
set class name
class for Name
Also, I declared activity tag in my manifest.
What should I do?

Related to Activity addition to manifest in Android

Is it compulsory to add a class file, which extends activity, to manifest?
I have created a java file for handling file IO and to use openfileoutput() openfileinput() i have extended Activity class.
YES you most declare it in the manifest so the application will know its activity.
If you use/call that class (which extends Activity) somewhere in your code, you MUST declare that class (Activity) in Manifest file. If you don't, you will get exception.
Manifest file is used to declared essential information for your app (Activity, Service, Broadcast Receiver, keys,...).
For more info about Manifest, you can check it here.
when you launch the application first the OS will check your manifest file.So if your Activity is not Listed in the Manifest file.Then it won't execute it.So your ACTIVITY class should be declared in the Manifest file.

I'm writing an Android module for trigger io that requires an activity be created, forge inspector can't find the activity

I'm writing a custom Android native module that needs to create an activity. I've added the activity to my ForgeModule project AndroidManifest.xml, but when I run the ForgeInspector project, ForgeInspector cannot find the activity when I start the intent.
Is there something special I need to do to get my module's manifest to get incorporated in the final product?
Here is the error when the intent is used to start the activity.
12-05 13:44:56.493: D/Forge(3867): Returned: {"content":{"message":"Forge Java error: ActivityNotFoundException: Unable to find explicit activity class {io.trigger.forge.android.inspector/io.filepicker.FilePicker}; have you declared this activity in your AndroidManifest.xml?","type":"UNEXPECTED_FAILURE","subtype":null,"full_error":"android.content.ActivityNotFoundException: Unable to find explicit activity class {io.trigger.forge.android.inspector/io.filepicker.FilePicker}; have you declared this activity in your AndroidManifest.xml?\n\tat android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1556)\n\tat android.app.Instrumentation.execStartActivity(Instrumentation.java:1431)\n\tat android.app.Activity.startActivityForResult(Activity.java:3391)\n\tat android.app.Activity.startActivityForResult(Activity.java:3352)\n\tat io.trigger.forge.android.modules.filepicker.API.importFile(API.java:26)\n\tat java.lang.reflect.Method.invokeNative(Native Method)\n\tat java.lang.reflect.Method.invoke(Method.java:511)\n\tat io.trigger.forge.android.core.ForgeApp.callJavaFromJavaScript(ForgeApp.java:316)\n\tat io.trigger.forge.android.core.ForgeJSBridge$1.run(ForgeJSBridge.java:25)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)\n\tat java.lang.Thread.run(Thread.java:856)\n"},"callid":"3AF217BD-F5B7-4873-A47F-CE3BF6D53214","status":"error"}
Did you correctly define the intent-filters and actions in the ForgeModule project AndroidManifest.xml file?

Activity Not Found Exception

I have sub-folders(packages) defined in an application, which has to be defined in Manifest file accordingly.
But after defining as per the conventions and as suggested by patrons in their posts, the application crashes. The error again in the logcat is
"03-17 19:38:54.118: E/AndroidRuntime(558): android.content.ActivityNotFoundException: Unable to find explicit activity class {in.co.avksons/prox_analysis.prox_main_scr}; have you declared this activity in your AndroidManifest.xml?"
I tried to look in each file on the specifics of the package, but could not find the error.
What are the possible causes for not acknowledging the package definition in the manifest file.
Thanks
Can you post your Manifest file? I have a feeling you are referencing your Activity incorrectly.
If for example you have an activity called TestActivity, and it was under the folder Activities, and your package name was com.test.app then you would reference your activity as follows:
com.test.app.Activities.TestActivity
You cant use '/' in the manifest file, use '.' instead.
Most likely, you have wrong declaration of activiy in Manifest. If you have package "com.application.view", for example, declaration will be like this:
android:name=".view.Activity"

Can an activity based application have no activity?

Assuming I have a shared activity class defined in a Library project, which does not change for any application using it and thus does not need to be subclassed, can I get a way with creating applications without subclassing this activity for them?
To better explain my question, say I have a single activity in a Library project:
public class LibActivity extends Activity {
...
}
And now I am creating an application using that Library project. Do I really need to create
public class AppActivity extends LibActivity {
// totally empty!
}
Only so that the application have its own activity to be referenced in its own AndroidManifest.xml?
Can I get a way with a minimalistic approach, in which I subclass the activity only if I need to modify the library's activity core behavior?
Here is the fully qualified answer:
Yes, an activity based application doesn't have to derive an activity from the library's activity. The application simply uses the library's activity verbatim, unmodified.
Yes, I can get a way with a minimalistic approach, in which I subclass the activity only if I need to modify the library's activity core behavior.
I have been able to verify this with an AndroidManifest.xml that is identical in both the library and the application. It would be interesting to see whether some of this redundancy can be eliminated. I will experiment with this and report back.
UPDATE: Sure enough, it is possible to create a perfectly running application in which the only activity is defined in the library and the library's AndroidManifest.xml doesn't have any <application> or <activity>! This is possible if the application's AndroidManifest.xml has them.
You can reference library Activity classes directly from your application AndroidManifest.xml. Just specify the fully qualified name like so android:name="com.example.LibActivity"

Categories

Resources