4

I have 3 different activity namely, category,sub_category and list of items. In sub_category i created back button using intent Activity. Back button in list_of items should be focus to sub_category. i dont know how to do this.. pls guide me..

2 Answers 2

6

from category activity call

Intent it=new Intent(category.this,sub_category.class)
startActivityForResult(it);

similarly

Intent it=new Intent(sub_category.this,list_item.class)
startActivityForResult(it);

and in onClickListener of back button simply finish your activity like

list_item.this.finish();
Sign up to request clarification or add additional context in comments.

Comments

0

for going back to previous screen u can call finish() in your current activity. It will remove the current activity from activity Stack and take you to the previous one.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.