Is there a way to say if an activity is selected then do something?
I dont know the statement which is why i am asking this question, but similar to this:
if(myactivity.isselected(true)){
webview3.reload();}
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.
If you are using tabs, then onTabChange() is the correct event for that. Not all tabs are individual activities. Not even necessarily different layouts. Then you can check to see if the selected tab is the activity like this
public void onTabChange(View v, int id) {
switch (v.getId()) {
case (R.id.tab1) {
//Do this
break;
}
}
The tabhost supports alot of functionality. Another funcitonis getTab() which will return the id (as an int) of the tab selected. Heres a link to the documentation http://developer.android.com/reference/android/widget/TabHost.html