Android Activity Group problem?
Suppose There are some activity.
I want to start another activity from the main activity. and another from that activity. and another from the next one.
This is how it is -
Main Activit开发者_Go百科y -> Activity 1 -> Activity 2 -> Activity 3
Now I want to switch from Activity 3 to Activity 2 , when i click the back button it will show Activity 2 for few second and came back to Activity 1 suddenly . it is not stable for back button press, sometime it bring it to main actitity.
I don't know is there any way to get it done.
If someone know about this. Let me know.
http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html refer to this will give u some solution for your problem. create intent and call the other activity.
intent i=new intent();
i.setclass(presentclassname.this,secondclass.class);
startActivity(i); will take u to other screen...
if u want to come back when u press on back button
just write the onClickListener()
of that button
back.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
tv.setText("");
finish();
}
will take u to the previous screen like this u can do...
精彩评论