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. we need SVG... now

I'm YADWSFSVGOA - 'yet another developer who is screaming for SVG on
Android'  !

Just do the right thing, turn it on, and release it now - this one
change deserves its own version increase.

SVG is an important part of HTML5, its a superb way of creating rich
interactive web apps and UIs that fit the problem, its infinitely
zoomable by default, it saves bandwidth, it has an excellent scripting
language, its interactive, its an open standard.. the list goes on.

Its just the right thing to do, and last year was the right time to
turn it on by default.

Its the one useful feature that iPhone has, that Android lacks.

gord.

gordon anderson
anderson web systems
quantblog.wordpress.com

-- 

2. Share on Droid Incredible doesn't list "Messaging"

Hi guys -- I have a user using a Droid Incredible, and he tells me
that when he shares images from my app (Photo Enhance), all the usual
suspects are listed (Twitter, Facebook and so on) but not messaging.

This isn't the case for my on my N1, nor on the emulator -- any idea
what I have to do differently. Here's my code at the moment (which
looks right to me, so I'm stumped):


                                        Intent msg = new 
Intent(Intent.ACTION_SEND);
                                        msg.setType("image/jpeg");
                                        msg.putExtra(Intent.EXTRA_STREAM, uri);
                                        
startActivityForResult(Intent.createChooser(msg, "Share
image"), PhotoEnhance.ACTIVITY_EXPORT);

Any ideas?

Thanks in advance,

Mark

-- 

3. How do I change the contents of a preference dialog when it is tapped?

4. How to Access Web service..!

5. App icon not working after upgrade, but reboot fixes the problem...

6. Which is the best method to post the Android Bitmap object from Application to Service ?

7. MySQL Connectivity