Difference between revisions of "Progress Dialog and Threads"
From John Freier
(Created page with ' private Handler handlerRefresh = new Handler() { @Override public void handleMessage(Message msg) { // Code to process the response and update UI. …') |
(No difference)
|
Revision as of 09:04, 27 January 2011
private Handler handlerRefresh = new Handler() { @Override public void handleMessage(Message msg) { // Code to process the response and update UI. Bundle resBundle = (Bundle) msg.obj; String question = resBundle.getString(BUNDLE_QUESTION); } }
...
dialog = ProgressDialog.show(CurrentActivity.this, "","Posting to twitter...", true);
new Thread(new Runnable() { public void run() { TwitterPost.Post(getBaseContext(), tweetString); Message myMessage=new Message(); Bundle resBundle = new Bundle(); resBundle.putString(BUNDLE_USER_ANSWER, tweetString); myMessage.obj=resBundle; handlerTwitterPost.sendMessage(myMessage); dialog.dismiss(); } }).start();
...
private ProgressDialog dialog;