几分钟后又发起新的活动。
很不幸,在任务完成之前就开始了?
package com.android.grad;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.widget.Toast;
public class LoginTask extends AsyncTask<Void, Void, Boolean> {
private Activity activity;
private ProgressDialog pd;
public LoginTask(Activity activity) {
this.activity = activity;
时 时
@Override
protected void onPreExecute() {
pd = ProgressDialog.show(activity, "Signing in",
"Please wait while we are signing you in..");
时 时
@Override
protected Boolean doInBackground(Void... arg0) {
try {
Thread.sleep(10000000);
时 时 catch (InterruptedException e) {
时 时
pd.dismiss();
return true;
时 时
@Override
protected void onPostExecute(Boolean result) {
Toast.makeText(activity, Boolean.toString(result), Toast.LENGTH_LONG).show();
时 时
时 时
并执行按键点击收听器的任务 :S
private OnClickListener loginOnClick = new OnClickListener() {
public void onClick(View v) {
new LoginTask(LoginActivity.this).execute();
startActivity(new Intent(LoginActivity.this, BuiltInCamera.class));
时 时
时 时;
有办法从我的亚亚亚星表开始活动吗?