タスクを使用しAsyncTask
て Web サーバーから応答をロードしています。応答に応じて、新しいアクティビティを開始したり、エラー メッセージを表示したりします。現在、クラスのonPostExecute
メソッド内でこれを実行しようとしています。Intent を作成しようとするとAsyncTask
、Constructor 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();
}
}
}