0

我的第一个活动的按钮点击代码是

b.setOnClickListener(new OnClickListener() {

    @Override
    public void onClick(View arg0) {
        // TODO Auto-generated method stub
        String text=e1.getText().toString();
        Intent i=new Intent(getApplicationContext(), editview.class);
        i.putExtra("mytext", text);
        CustomListViewAndroidExample.this.startActivity(i);
    }
});

第二个活动代码是

et1=(EditText)findViewById(R.id.editText1);
et1.setText(getIntent().getStringExtra("mytext"));
4

2 回答 2

0

Try getting the info as such

Intent intent = new Intent();
    intent = getIntent();
    Bundle bundle = intent.getExtras();
    language = bundle.getString("Language");

setting it as so

  language="bla";
    intent.putExtra("Language", language);
            startActivity(intent);
于 2013-09-28T10:57:36.487 回答
0

使用以下代码:

 @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            String text=e1.getText().toString();
            Intent i=new Intent(CustomListViewAndroidExample.this, editview.class);
            i.putExtra("mytext", text);
            startActivity(i);
        }
    });
于 2013-09-28T10:33:56.667 回答