Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
open content on click of button
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
pankajdev  
View profile  
 More options Aug 8 2012, 9:18 am
From: pankajdev <pankajde...@gmail.com>
Date: Wed, 8 Aug 2012 06:18:57 -0700 (PDT)
Local: Wed, Aug 8 2012 9:18 am
Subject: open content on click of button

Hi ,

i am new to this forums , i have tried a sample android application using
MOTODEV studio , i am not able to find few things , like how to setup the
action for the button and if i setup an action how do i open the layout
while i click over the button , i am having six button ,now i want if i
click over one button it should load the layout or should be send to next
screen to display content.

Please guide with example or same code so that learning is easy.

with regards


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Parthi K  
View profile  
 More options Aug 8 2012, 9:48 am
From: Parthi K <parthisof...@gmail.com>
Date: Wed, 8 Aug 2012 19:18:05 +0530
Local: Wed, Aug 8 2012 9:48 am
Subject: Re: [android-developers] open content on click of button

Hi pankajdev,       just pass onclicklistener
use getId values...
and pass resources layout...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bob  
View profile  
 More options Aug 8 2012, 10:10 am
From: bob <b...@coolfone.comze.com>
Date: Wed, 8 Aug 2012 07:10:28 -0700 (PDT)
Local: Wed, Aug 8 2012 10:10 am
Subject: Re: open content on click of button

Button b = findViewById(R.id.button);

b.setOnClickListener(new OnClickListener() {

 @Override

public void onClick(View v) {

 // Button clicked

  }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pankajdev  
View profile  
 More options Aug 8 2012, 10:36 am
From: pankajdev <pankajde...@gmail.com>
Date: Wed, 8 Aug 2012 07:36:22 -0700 (PDT)
Local: Wed, Aug 8 2012 10:36 am
Subject: Re: [android-developers] open content on click of button

hey parthi, thanks but actually i look forward for where to pass , if u
have sample code do share else see the below code is used to achieve is
this right , now can you suggest if i have loaded another layout how can i
come back to the previous one or the main one , i am now trying with the
back button can u suggest.

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        final Button button = (Button) findViewById(R.id.button1);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                // Perform action on click

             setContentView(R.layout.aboutus);
            }
        });

        final Button buttonhome = (Button) findViewById(R.id.button1);
        buttonhome.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                // Perform action on click

             setContentView(R.layout.main);
            }
        });
    }

 }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pankajdev  
View profile  
 More options Aug 8 2012, 10:37 am
From: pankajdev <pankajde...@gmail.com>
Date: Wed, 8 Aug 2012 07:37:41 -0700 (PDT)
Local: Wed, Aug 8 2012 10:37 am
Subject: Re: open content on click of button

@bob thanks your reply is correct but i am now little step ahead and look
forward for further help , please see


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bob  
View profile  
 More options Aug 8 2012, 10:44 am
From: bob <b...@coolfone.comze.com>
Date: Wed, 8 Aug 2012 07:44:06 -0700 (PDT)
Local: Wed, Aug 8 2012 10:44 am
Subject: Re: open content on click of button

You can add this method to your Activity to handle the pressing of the back
button on the device:

@Override

public void onBackPressed() {

super.onBackPressed();

// handle back button press


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »