Issue
I want to create a button that would lead the user straight back to main activity which doesn't have the android name="com.example.example".
It has android.intent.etc...
How can I reference my button to go back to this activity?
Solution
Lets say your main activity is called Main.java.
btnBack.setOnClickListener(new OnClickListener(){
private void onClick(){
Intent intent = new Intent(currentActivity.this, Main.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}
});
Answered By - zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.