0

Sometimes I've got situations that I want to make "light" operation like showing UI view and after that I want to show large set of UI views. I make it this way:

smallView.setVisibility(View.VISIBLE);
largeSetOfViews.setVisibility(View.VISIBLE);

the result is that smallView and largeSetOfViews become visible at the same moment.

I want to make:

smallView.setVisibility(View.VISIBLE);
FLUSH_UI
largeSetOfViews.setVisibility(View.VISIBLE);

to have smallView visible before largeSetOfViews will be visible.

To make flush I do:

smallView.setVisibility(View.VISIBLE);
Handler handler = new Handler();
handler.post(new Runnable() {
    @Override
    public void run() {
        largeSetOfViews.setVisibility(View.VISIBLE);
    }
});

Is there any better solution for making Flush UI?

Bystysz
  • 681
  • 1
  • 6
  • 8
  • have you tried Thread.sleep(long) before setvisibility of largesetofviews? – harveyslash Jul 21 '14 at 08:58
  • Yes, it also works, the same as Handler.postDelayed, but it's not pure flush. We have no guarantee that argument for sleep function will be enough to show view. – Bystysz Jul 21 '14 at 12:04

0 Answers0