Hi all,

I'm trying to create a simple example with 2 activities:
1.  A simple Welcome (the MAIN):  A simple welcome screen with a
button.
2.  A MapActivity (class=Quester) which simply displays a map.

a) The MapActivity (Quester) works by itself when the manifest gives
it the MAIN, like this
    <activity android:name=".Quester" android:label="@string/
app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
     </activity>

b) Pressing the button on the welcome screen /tries/ to invoke an
Intent to start the quester activity
but it throws an ActivityNotFoundException (details below); here's the
Intent code:

   private void checkLogin(QLogin loginActivity, String userId, String
passwd)
    {       // right now a stub always returning true:
        boolean authOk = authenticateUser(userId, passwd);
        if (!authOk){
                Toast.makeText(this, "Unknown userid/password combo",
Toast.LENGTH_SHORT).show();
        } else {
                Toast.makeText(this, "Trying to move to Quester Map",
Toast.LENGTH_SHORT).show();
                Intent questerMapIntent = new Intent(".Quester.VIEW");
                startActivity(questerMapIntent);
        }
    }
c) The complete manifest is:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
    package="com.herenow.android.quester">
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".QLogin" android:label="@string/
app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Quester" android:label="@string/
app_name">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
            </intent-filter>
        </activity>
        <uses-library android:name="com.google.android.maps" />
    </application>
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

d)  The error output in LogCat is the following:

.....getting started....
09-11 20:39:50.307: INFO/jdwp(1377): received file descriptor 13 from
ADB
09-11 20:39:50.646: INFO/ActivityManager(47): Displayed activity
com.herenow.android.quester/.QLogin: 631 ms
09-11 20:39:55.736: DEBUG/dalvikvm(116): GC freed 3 objects / 72 bytes
in 69ms
09-11 20:39:55.746: DEBUG/dalvikvm(91): GC freed 880 objects / 43376
bytes in 61ms
09-11 20:39:56.666: INFO/NotificationService(47): enqueueToast
pkg=com.herenow.android.quester
[EMAIL PROTECTED]
duration=0
09-11 20:39:56.676: INFO/ActivityManager(47): Starting activity:
Intent { action=.Quester.VIEW }
09-11 20:39:56.687: DEBUG/AndroidRuntime(1377): Shutting down VM
09-11 20:39:56.687: WARN/dalvikvm(1377): threadid=3: thread exiting
with uncaught exception (group=0x40010e28)
09-11 20:39:56.696: ERROR/AndroidRuntime(1377): Uncaught handler:
thread main exiting due to uncaught exception
09-11 20:39:56.706: ERROR/AndroidRuntime(1377):
android.content.ActivityNotFoundException: No Activity found to handle
Intent { action=.Quester.VIEW }
09-11 20:39:56.706: ERROR/AndroidRuntime(1377):     at
android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:
1469)
09-11 20:39:56.706: ERROR/AndroidRuntime(1377):     at
android.app.Instrumentation.execStartActivity(Instrumentation.java:
1439)
09-11 20:39:56.706: ERROR/AndroidRuntime(1377):     at
android.app.Activity.startActivityForResult(Activity.java:2527)
09-11 20:39:56.706: ERROR/AndroidRuntime(1377):     at
android.app.Activity.startActivity(Activity.java:2571)

I've tried the following versions for the Intent descriptor (keeping
them coordinated in the code and the manifest):
        Quester.VIEW
        .Quester.VIEW
        com.herenow.android.quester.Quester.VIEW
and
    .Quester.VIEW in manifest and Quester.VIEW in code   .

So I'm missing one or more points here.
Can anyone help me out?
Many thanks in advance,
Ken


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to