I have implemented Tab host
with the Notification
. Now My problem is: there are 3 tabs like Food, Health and Service. If i receive a Food Notification How to highlight the Food Tab automatically
How to highlight a Tab when Notification received
171 views Asked by ravi chandra At
2
There are 2 answers
0
On
For switching to some other tab than the default one you need to put this code on the onClick or whatever triggers the action
TabActivity tabs = (TabActivity) getParent(); tabs.getTabHost().setCurrentTab(x);
Just replace x with the tab which you would like to navigate to and make sure to change the variable names and class names as per your project. Hope it helps you ;)
Do like this :
First Step: Create a broadcast receiver which you can call when you click on notification
Second Step: in onReceive() method put below line:
That's it.