• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to make loading layout 2sec?

luka1995

Lurker
Hi, i want to create loading layout and i don't know how...

private View controlView;
private View loadingView;


@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
controlView = inflater.inflate(R.layout.main, null);
loadingView = inflater.inflate(R.layout.loading, null);

setContentView(loadingView);

try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

setContentView(controlView);
}

that doesn't work
tnx
 
Back
Top Bottom