我在AsyncTask类中有这个代码:
protected void onPostExecute(Integer result)
{
if (result == 1)
{
try {
Global.mmOutStream.write(99);
} catch (IOException e) { }
Intent intentTrashcanLocation = new Intent(TrashcanLocationActivity.this, TrashcanLocationActivity.class);
startActivity(intentTrashcanLocation);
}
}
这让我在" Intent
"行:
TrashcanOnWayActiity$waitarrival [line:53] - onPostExecute(Integer)
TrashcanLocationActivity
的封闭实例
我想要做的是基本上每当我异步获得某些输入时显示下一页。我无法解决这个问题。任何帮助将非常感谢!
答案 0 :(得分:2)
您正在使用相同的课程
Intent intentTrashcanLocation = new Intent(TrashcanLocationActivity.this,
TrashcanLocationActivity.class);
startActivity(intentTrashcanLocation);
应该是一致的
Intent intentTrashcanLocation = new Intent(TrashcanLocationActivity.this,
TrashcandetailActivity.class);
startActivity(intentTrashcanLocation);
答案 1 :(得分:0)
试试这个,
@Override
protected void onPostExecute(Void result)
{
super.onPostExecute(result);
if (result == 1)
{
try {
Global.mmOutStream.write(99);
} catch (IOException e) { }
Intent intent = new Intent(TrashcanLocationActivity.this, NextActivity.class);
getApplicationContext().startActivity(intent);
}
}
答案 2 :(得分:0)
您的代码没问题,但您再次调用相同的活动
Intent intentTrashcanLocation = new Intent(TrashcanLocationActivity.this, TrashcanLocationActivity.class);
startActivity(intentTrashcanLocation);
将TrashcanLocationActivity.class
替换为您要调用的活动.class