-1

タスクを使用しAsyncTaskて Web サーバーから応答をロードしています。応答に応じて、新しいアクティビティを開始したり、エラー メッセージを表示したりします。現在、クラスのonPostExecuteメソッド内でこれを実行しようとしています。Intent を作成しようとするとAsyncTaskConstructor is undefinedエラーが発生します。

これが私のコードです:

protected void onPostExecute(String result) {  
      // code thate xcicutes after thread
      if ( result.contains("OK"))
        {
            PreSave();

            Intent I;

            if (ChatOrGame==1)
               i = new Intent(cGlobals.mParent );
            else
                i = new Intent(cGlobals.mParent);

            startActivity(i);       
        }
        else
        {
            if (bInternetError==false)
            {
            new AlertDialog.Builder( cGlobals.mParent)
            .setTitle("Log In Error")
            .setMessage( "User name or password" )
            .setNeutralButton("close",new DialogInterface.OnClickListener()
            {
                public void onClick(DialogInterface dlg, int i)
                {

                }} ).show();            

            }
        }
  }
4

1 に答える 1