can any on explain why button is getting displayed.
xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<Button
android:layout_below="@+id/tt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Simple Button"/>
</RelativeLayout>
MainActivity
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(), "onCreate", Toast.LENGTH_SHORT).show();
}
}, 10000);
// Looper.loop();
}
}
For above code out put is
For above code out put is (when i uncomment Looper.loop())
can any one explain this. What Looper.loop() is doing to not display the button on ui. Things i know is Looper is what im using is main ui threads Looper.
i know Looper is already running(looping over the messages) and im calling Looper.loop(); I just want to know what is does that button drawing wont happen on the ui thread means does that Looper get reset or removes some message. exactly what happen when we call Looper.loop() on a thread looper when its already looping.