0

用相机拍照后,我试图更改 Button 属性。

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode != RESULT_OK) return;

        Bitmap bitmap = utilities.decodeFile(path, 300);
        imgPicHolder.setImageBitmap(bitmap);
        //The pic is changing on the previous Activity, this works fine



        Button button = (Button)findViewById(R.id.btnChange);
         button.setText("NewText");
        //Here is the problem, when trying to change the button property from the previous      activity before taking the picture..



}
4

1 回答 1

1

我要做的就是将它String从via和 in传递Activity2给,用于检索它,然后将其设置为's中的文本Activity1Intent.putExtra()Activity1getIntent().getStringExtra()stringButtonActivity1onResume()

于 2012-11-29T11:32:02.660 回答