MyCoding...
------------------
PathClassLoader loader = new PathClassLoader(
"/data/data/com.google.apk/com.google.android/AirStrike.apk",
ClassLoader.getSystemClassLoader().getParent());
Class calledClass = loader.loadClass("com.google.android.AirStrike");
Intent it = new Intent(ac, calledClass);
it.setAction("android.intent.category.MAIN");
it.addCategory("android.intent.category.LAUNCHER");
it.setClassName("com.google.apk", "com.google.android.AirStrike");
it.addLaunchFlags(Intent.NEW_TASK_LAUNCH);
it.setComponent(new ComponentName(this, calledClass));
startActivity(it);
Error
--------
INFO/WESLEY(998): START
INFO/ActivityManager(510): Starting activity: Intent {
action=android.intent.category.MAIN
categories={android.intent.category.LAUNCHER} launchFlags=4
comp={com.google.apk/com.google.android.AirStrike} }
INFO/WESLEY(998): ERROR android.content.ActivityNotFoundException: Unable to
find explicit activity class {com.google.apk/com.google.android.AirStrike};
have you declared this activity in your AndroidManifest.xml?
hi,
I still getting the same error... anyone have any idea on it???
Wesley.
On Sat, Jun 7, 2008 at 8:21 PM, David Given <[EMAIL PROTECTED]> wrote:
> Wesley wrote:
> [...]
> > 1. Basically the error mean I did not declare activity in manifest
> > where generate this error when I start activity... What I intent to do
> > is to start activity without declare it at manifest... How can I hard
> > code those manifest info inside my code to start an activity?
>
> I'm not sure you can. I believe you have to declare activities in the
> manifest for them to work at all.
>
> However, if you're going to start each one explicitly, you don't need to
> declare it with any parameters:
>
> <activity android:name="SpecialActivity"/>
>
> Intent intent = new Intent();
> intent.setComponent(new ComponentName(this, SpecialActivity.class));
> startActivity(intent);
>
> When declared like this, the *only* way you can start it is to create an
> intent and use setComponent(), so you don't have to worry about other
> people launching your activity when they're not supposed to. Does this
> match what you're trying to do?
>
> --
> ┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
> │ "I have always wished for my computer to be as easy to use as my
> │ telephone; my wish has come true because I can no longer figure out
> │ how to use my telephone." --- Bjarne Stroustrup
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---