If I am one an activity and I know another activity is running, how can I change the button text from that other activity?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Another activity is running but it is in
onPauseand you can’t guarantee that activity will not destroy before you going back to there again.So you should better look at
onResumeof the activity to update the button text.If you still want to change the button text while activity is onPause you can use a broadcast receiver on the activity that will change the text.You can also use a handler along with runnable to update button text.