//Layout3 OnClick
private OnClickListener btnLayout3OnClick=new OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
// 切換視窗 +參數傳遞
Intent intent=new Intent(MainActivity.this, MainActivity_01.class);
intent.putExtra("param1", edtEdit1.getText().toString());
MainActivity.this.startActivity(intent);
MainActivity.this.finish();
}};
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_activity_01);
//接收傳遞參數
Intent itIntent;
itIntent = this.getIntent();
strParam1 = itIntent.getStringExtra("param1");
edtEdit1.setText(strParam1);
}
沒有留言:
張貼留言