Results 1 to 5 of 5
Thread: [HELP] Linking buttons
- 01-08-2013, 07:05 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 1
- Rep Power
- 0
[HELP] Linking buttons
Hi all,
First of all I would like to say that I'm new to this forum and to Java Eclipse aswell. For my exams I have to make a (simple) android application.
I'l explain what I would like to have:
I'm trying to have a button when I click on it I will go to another page (activity). I'm new to how all of this works so a simple explination would be appreciated.
I've tried many internet searchs but this did not help,so I'm trying it here.
Hope you can help me sort this out,If you need any more information feel free to ask.
Thanks in advance,
Rick
- 01-08-2013, 07:16 PM #2
Re: [HELP] Linking buttons
I believe you can use the setContentView() function. I haven't made a lot of stuff on android.
Have a look at this:
Starting an Activity | Android Developers
You will also need to set an OnClickListener for your button.
View.OnClickListener | Android Developers
I think that this was meant to be posted on Android .
Based on the grammar, I would just like to point out that Java and Eclipse are two different things.Last edited by PhQ; 01-08-2013 at 07:21 PM.
- 01-08-2013, 09:11 PM #3
- 01-17-2013, 01:59 PM #4
Member
- Join Date
- Nov 2012
- Location
- India
- Posts
- 70
- Rep Power
- 0
Re: [HELP] Linking buttons
Hi,
I hope this will be help to u...
Button Tbutun;
public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.main);
Tbutun=(Button)findViewById(R.id.button1) //change the id as per yours
Tbutun.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class);
startActivity(myIntent);
}
});
Thanks,
- 01-17-2013, 05:27 PM #5
Re: [HELP] Linking buttons
tamilarasi, please go through the Guide For New Members and BB Code List - Java Programming Forum - Learn Java Programming and edit your post accordingly.
This is a programming forum, not SMS chat. Please spell words in full -- you not u
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
linking jframe
By vinodpatole in forum NetBeansReplies: 4Last Post: 01-20-2012, 11:15 PM -
linking to a web page
By Juuno in forum Advanced JavaReplies: 7Last Post: 05-01-2009, 02:47 PM -
static linking
By Nicholas Jordan in forum Advanced JavaReplies: 35Last Post: 03-14-2009, 09:17 PM -
linking 2 Jframes
By suhaib1thariq in forum New To JavaReplies: 9Last Post: 02-13-2009, 01:30 AM -
Linking of exe files
By archu2friends in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 02-06-2008, 06:08 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks