通过第一个线程onpost()启动第二个后台线程

时间:2013-06-05 08:26:04

标签: android android-asynctask

我创建了两个后台线程,但第二个线程没有启动。第一个线程工作正常。当第一个线程运行时,会显示一个进程条,并在线程被解除后不久。解雇后,我的第二个线程没有启动。我不知道我做错了什么。

这是我的代码:

new first(login.this).execute();

class first extends AsyncTask<String, Void, String[]>
{
   public first (Context context)
  {
      this.context = context;
      dialog = new ProgressDialog(this.context);
      dialog.setMessage("Please Wait...");
  }
 @Override
 protected void onPreExecute() {
     super.onPreExecute();
         this.dialog.show();
         this.dialog.setCancelable(false);
       }
     protected  String[] doInBackground(String... urls) {
              return values;
           }

 @Override
    protected void onPostExecute(String[] r) {
        super.onPostExecute(r);
       dialog.dismiss();

       // starting second but not starting.
      new RetreiveFeedTask(secondclass.this).execute();

   }

}

0 个答案:

没有答案
相关问题