Intent的Flags有何作用?
在看ApiDemos中APP/Activity/Reorder Activities这个例子时,ReorderFour这个类中的intent对象加入FLAG_ACTIVITY_REORDER_TO_FRONT 这个Flag,但我把intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);这句话注释掉,也没发现有什么不同啊。
public class ReorderFour extends Activity { @Override protected void onCreate(Bundle savedState) { super.onCreate(savedState); setContentView(R.layout.reorder_four); Button twoButton = (Button) findViewById(R.id.reorder_second_to_front); twoButton.setOnClickListener(mClickListener); } private final OnClickListener mClickListener = new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(ReorderFour.this, ReorderTwo.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent); } };}