I’m following the example here:
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
Everything works fine. The first time I click on each tab, the oncreate method for Activity bound to that particular tab is called. However, subsequent selections of the tab’s do not call this oncreate method.
I need to be able to execute oncreate (or another method) on the Activity that is bound to each Tab, when that tab is selected. I know I can use a setOnTabChangedListener, but I am unsure how to get access to the Activity that is bound to the tab, so that I can call the oncreate (or another) method.
It’s a matter of efficiency… that’s why your
onCreatemethod is not being called twice or more times. The eaiser way to access your activity from yourTabActivitythrough theOnTabChangedListeneris this:Then, on your child activity, you have something like:
It’s not beauty, but it works fine.