活动 myActivity1:
Intent i = new Intent(this, myActivity2.class);
i.putExtra("type", type);
if(type == 1)
{
i.putExtra("namesArray", myArray);
}
startActivityForResult(i, 1);
活动 myActivity2:
//inside onResume()
if(getIntent().hasExtra("type"))
{
Log.i(tag, "Has extra");
}
else
{
Log.i(tag, "No extra type");
}
我总是明白"No extra type"
为什么?