A的ACTIVITY要切換到B的ACTIVITY,用法是使用Intent。傳遞餐屬使用putExtra方法。如以下

Intent intent = new Intent(A.this, B.class);
intent.putExtra("sex", sex);
intent.putExtra("selectType", selectType);
startActivity(intent);


而B的ACTIVITY切收資料方式如下。
private int sex;
private int type;
sex = getIntent().getExtras().getInt("sex");
type = getIntent().getExtras().getInt("selectType");
arrow
arrow
    全站熱搜

    戮克 發表在 痞客邦 留言(0) 人氣()