There's a way to know when a fragment is effective drawn (and become visible to user) inside a FragmentActivity? Because i need to get coordinates of some wiews inside fragment, and i need that it is visible before do that
Asked
Active
Viewed 333 times
0
-
Perhaps this is what you're looking for? http://stackoverflow.com/questions/10024739/how-to-determine-when-fragment-becomes-visible-in-viewpager – Ben Pearson Feb 13 '14 at 14:37
-
They talk about ViewPager, and i don't have a viewpager ! – giozh Feb 13 '14 at 14:38
-
The ViewPager is moot - you can use the setUserVisibleHint on the fragment. You can then expose that via public method to your activity – Ben Pearson Feb 13 '14 at 14:44
1 Answers
1
Inside Fragment
onCreateView
you use following:
View view = ...
view.post(new Runnable() {
@Override
public void run() {
// do stuff
}
});
return view;
I hope I remembered the syntax all correct from the memory :)

Niko
- 8,093
- 5
- 49
- 85
-
for accept answer i need to wait some minutes before. StackOverflow policy! – giozh Feb 13 '14 at 15:12