Hi....we can navigate from one screen to another with the help of
intent....as u said u created 3 activites u need to call 2nd intent in first
activity ,and u need to cal 3rd activity from 2nd activity......from 3rd
activity u need to back to previous activiy right der is a method.....i wil
give u code just u can follow ......
here iam giving example here u can go to 2nd activity and from 2nd activiy u
can come back to 1st activity for this u hav to create 2xml files with
buttons dats not big deal to u...just iam giving code ok...
1st activity........................
public class IntentBundle extends Activity implements OnClickListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent in2=getIntent();//getIntent()=Return the intent that started
this activity
String str;
str=in2.getStringExtra("name1");
TextView tv=(TextView)findViewById(R.id.txt);
tv.setText("Your Name is:"+str);
Button btn=(Button)findViewById(R.id.btn);
btn.setOnClickListener(this);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent in=new Intent(getApplicationContext(),Sec.class);
/*Bundle b = new Bundle();
b.putString("friendsname", "Rambabu");
in.putExtras(b);
*/
in.putExtra("name", "100");
startActivity(in);
}
}
..............................2nd activity
public class Sec extends Activity implements OnClickListener {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sec);
TextView tv=(TextView)findViewById(R.id.txt);
tv.setText("From Secound");
Button btn1=(Button)findViewById(R.id.btn1);
btn1.setOnClickListener(this);
Intent in=getIntent();
String str=in.getStringExtra("name");
int i=Integer.parseInt(str);
int r=i+i;
tv.setText("Total Of Two Numbers="+Integer.toString(r));
/* Bundle b = in.getExtras();
if(b != null){
String frname = b.getString("friendsname");
tv.setText(frname);
}
*/
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent in1=new Intent(getApplicationContext(),IntentBundle.class);
in1.putExtra("name1", "Rambabu");
startActivity(in1);
}
}
On Tue, Jul 26, 2011 at 4:37 AM, aparna rani <[email protected]> wrote:
> hi to all I am new to android development. in my application i
> have three activities.
> in 1st ui and second ui each ui having one button for ui calling
> 3rd.in 3rd ui having back button.when pressing back button it comes to
> previous calling ui.
> how can i implement.
>
> please help me.
>
> thanks in andvanced
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en