Difference between revisions of "Progress Dialog and Threads"
From John Freier
Line 10: | Line 10: | ||
} | } | ||
} | } | ||
− | |||
dialog = ProgressDialog.show(CurrentActivity.this, "","Posting to twitter...", true); | dialog = ProgressDialog.show(CurrentActivity.this, "","Posting to twitter...", true); |
Revision as of 09:07, 27 January 2011
private ProgressDialog dialog;
private Handler handlerRefresh = new Handler() { @Override public void handleMessage(Message msg) { Bundle resBundle = (Bundle) msg.obj; String question = resBundle.getString("key"); } }
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();