سؤال

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

هل كانت مفيدة؟

المحلول

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 :)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top