how to move from one screen to another ?

by Ashwani Rao » Wed, 28 Jan 2009 17:54:20 GMT


Sponsored Links
 Hi,

i have created an activity which brings an UI with buttons for various
actions.
I want to associate various actions/call with these buttons.
How i can do this ?
For example i  click a button the then i should move to different screen.

Reagrds,
Ashwani

--~--~---------~--~----~------------~-------~--~----~



how to move from one screen to another ?

by Mark Murphy » Wed, 28 Jan 2009 20:55:58 GMT


 


You need to add OnClickListeners to the Buttons (via
setOnClickListener()) to get control when they are clicked. You can use
Activity#startActivity() to then launch another activity, or do whatever
you like.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


how to move from one screen to another ?

by PRATAP SOLAPUR » Fri, 30 Jan 2009 14:38:29 GMT


 U should write another activity that displays ur next view n make a call to
it by using startActivity().........or u can just change the view of current
activity on button click by calling setContentView()...........




--~--~---------~--~----~------------~-------~--~----~



how to move from one screen to another ?

by Ziv Tatian » Sun, 01 Feb 2009 01:56:24 GMT


 Hi all,

I have two activities that i've created: a welcome screen with a
continue button on it, and a user details activity.
I want to go to the user details activity from my welcome activity
when i click on the continue button.
I've tried the following code but i get an error when i try to run it
on the emulator whenever i press the continue button.
here's the code:

public class Welcome extends Activity {
    /** Called when the activity is first created. */

        @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button continueButton = (Button) findViewById(R.id.go);
                continueButton.setOnClickListener(new View.OnClickListener() {

                    public void onClick(View view) {
                    Intent mIntent = new Intent(view.getContext
(),UserData.class);
                    startActivity(mIntent);
                    }
                });
    }

}

can anyone help with that?

thanks.
--~--~---------~--~----~------------~-------~--~----~



how to move from one screen to another ?

by Mark Murphy » Sun, 01 Feb 2009 01:58:09 GMT


 


What is the error as reported in the error log? (adb logcat, DDMS, or
Eclipse to examine the log)

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

--~--~---------~--~----~------------~-------~--~----~



how to move from one screen to another ?

by Ziv Tatian » Sun, 01 Feb 2009 03:50:24 GMT


 this is what i get in the error log:

I/ActivityManager(   51): Starting activity: Intent { comp=
{com.android.agent/co
m.android.agent.UserData} }
D/AndroidRuntime(  182): Shutting down VM
W/dalvikvm(  182): threadid=3: thread exiting with uncaught exception
(group=0x4
0010e28)
E/AndroidRuntime(  182): Uncaught handler: thread main exiting due to
uncaught e
xception
E/AndroidRuntime(  182): android.content.ActivityNotFoundException:
Unable to fi
nd explicit activity class {com.android.agent/
com.android.agent.UserData}; have
you declared this activity in your AndroidManifest.xml?

added the activity to the manifest and it worked great ;-)
thanks for the tip!





--~--~---------~--~----~------------~-------~--~----~



how to move from one screen to another ?

by Roberts, Mark » Sun, 01 Feb 2009 08:10:48 GMT


 The thing that always gets me is that I have not defined the second
activity in the manifest.

Snapper 

-----Original Message-----
From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of Mark Murphy
Sent: Saturday, January 31, 2009 12:58 PM
To: android-beginners@googlegroups.com
Subject: [android-beginners] Re: how to move from one screen to another
?




View.OnClickListener() {

What is the error as reported in the error log? (adb logcat, DDMS, or
Eclipse to examine the log)

--
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~---------~--~----~------------~-------~--~----~



how to move from one screen to another ?

by Christian Mart铆n Reinhold » Sun, 01 Feb 2009 19:24:59 GMT


 ou hav to add a new tag on the android manifest so that android knows
what activities are in play. So, you simply add this tag inside the
application tag of your android manifest (double click the android
manifest in eclipse and go to the xml tab)

< manifest ....>
<application...>

<activity android:name="com.android.agent.UserData"></activity>
</application>
</manifest>

Inside your activities you can add permissions as well, otherwise some
intent actions won't work


<activity android:name="com.android.agent.UserData">
<intent-filter>
<action android:name="android.settings.LOCALE_SETTINGS"></action>
</intent-filter>
</activity>

You can define user permissions right afeter your application tag, or
simply use the permissions tab to add permisions

< manifest ....>
<application...>
<activity ...></activity>
<activity ...></activity>
<activity ...></activity>
<activity ...></activity>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.CHANGE_CONFIGURATION"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
</manifest>

Good luck!

On Jan 31, 7:21pm, "Roberts, Mark" <mark.robert...@t-mobile.com>
wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Possible in emulator? Querrying google map? Unlocking Anrdoid Example

Hello,

I am super new to Android development.

Can the emulator use google maps from within an application (via intents)?

I was trying to run through one of the first sample applications
developed in the book "Unlocking Android" in chapter 1 (p 27, section
1.4) which lets you put in an address and will then pull it up in
google maps. When I try to run it I always get a failure to launch
when I call startActivity as shown in listing 1.7.

Is this perhaps dependent on the SDK level?

The sample chapter is free and legally available at
http://www.manning.com/ableson/SampleChapter1.pdf and I'd appreciate
if anyone could point out a possible reason for this problem, or if
this even possible.

Thanks.

-- 

2. Trying to Call a webservice on host from ADB

Hello all!

In the emulator I can make a Http request to the host 10.0.2.2 and my
local webserver will catch it. Is there anyway to accomplish this same
thing while debugging on an ADB (Motorala Droid)?


Thanks,
Josh

-- 

3. Android SDK and AVD Manager Failed to fetch URL:HTTPS SSL error

4. No devices listed in "adb devices"

5. Recommended resources/books/websites/etc. for getting up to speed on all I need for Android development

6. How to invoke a direction in Google Maps App

7. connecting to remote database