Wednesday, October 30, 2013

refresh a fragment from its parent activity [android help]


refresh a fragment from its parent activity



I have almost the exact same problem as this question here: Android, How to restart/refresh a fragment from FragmentActivty?


I'm trying to call the a method of a ListFragment from the parent FragmentActivity.


However, I'm using the template Swipe + Fixed Tabs generated by eclipse. I tried calling getSupportFragmentManager().findFragmentById(R.id.myfragment) but the return value is always null. I'm guessing this might be a problem because I did not define myfragment anywhere in my app. But I am unsure where to define it as all fragments are created dynamically.


For those who are not familiar with the Swipe + Fixed Tabs template generated by the Android SDK in Eclipse, the fragments are created by overriding the FragmentPagerAdapter getItem function, returning a new instance of my fragment.


Any help would be appreciated.



Read more

stackoverflow.comm



No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...