kfealz wrote:
> I'm building my first Android app, and it's pretty confusing.  I'm
> picking it up pretty well (or at least the minimal stuff I need to
> know at this point), but I'm having one fairly significant issue.  I
> haven't been able to figure out how to start a new activity.
> 
> I know to create an intent: Intent launchSuccess = new Intent()
> and I know to call startActivity(Intent intentname)
> 
> However, I'm not sure what to send into Intent() or what I have to do
> in AndroidManifest.xml to get it to work.
> 
> Here's what I have:

<snip>

> The following is Success's entry in AndroidManifest.xml
>  <activity android:label="@string/app_name" android:name="Success">
> <intent-filter>
> <action android:name="com.straightforwardcode.action.Success.MAIN">
> </action></intent-filter></activity>

Usually, the android:name attribute will start with a leading dot, 
indicating that the activity's class can be found under the package 
declared in the root manifest element of the manifest file. For example:

<manifest xmlns:android="http://schemas.android.com/apk/res/android";
        package="com.commonsware.android.foo">
        <application>
                <activity android:name=".Foo" android:label="Foo">
                        <intent-filter>
                                <action 
android:name="android.intent.action.MAIN" />
                                <category 
android:name="android.intent.category.LAUNCHER" />
                        </intent-filter>
                </activity>
        </application>
</manifest>

Here, the android:name of ".Foo" means Android will interpret Foo as 
being com.commonsware.android.foo.Foo, since com.commonsware.android.foo 
is the package declared at the top.

The one you have doesn't show a leading dot, meaning Android might think 
that "Success" is the fully-qualified class name including package. 
Assuming that's not the case, try adding the dot and see if it helps.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
The Busy Coder's Guide to Android Development -- coming in June 2008!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to