private class ConnectTask2 extends AsyncTask<Void, Void, Void> {
private ProgressDialog progressDialog;
@Override
protected void onPreExecute() {
super.onPreExecute();
progressDialog = new ProgressDialog(context);
progressDialog.setMessage("트위터로 로그인 중입니다.");
progressDialog.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
cancel(false);
}
});
progressDialog.show();
}
@Override
protected Void doInBackground(Void... v) {
twitterLogin();
return (Void)null;
}
@Override
protected void onProgressUpdate(Void... v) {
//TODO show progress
}
@Override
protected void onPostExecute(Void v) {
progressDialog.dismiss();
((TextView) findViewById(R.id.txtTwitterConnect)).setText("트위터연동중");
((Button) findViewById(R.id.btnTwitterConnect)).setVisibility(View.INVISIBLE);
((TextView) findViewById(R.id.TwitterID)).setVisibility(View.VISIBLE);
((TextView) findViewById(R.id.TwitterID)).setText(twitterScreenName);
}
}
댓글 없음:
댓글 쓰기