How to show android ui

In case show Android ui for example Toast.
Simply Toast.show() is invalid.
We must call ui in UiThread.
or use handler.


// show ui
runOnUiThread(new Runnable() {
		@Override
		public void run() {
				Toast.makeText(activity,"ui",Toast.LENGTH_LONG).show();;
		}
});
		

Care for UiThread.

このエントリーをはてなブックマークに追加