我如何选择照片并从相机拍照并发送到具有共享偏好的下一个活动
这是来自功能 camara
btncamera.setOnClickListener(new OnClickListener() {
@SuppressLint("SimpleDateFormat")
public void onClick(View v) {
SharedPreferences app_preferences =
PreferenceManager.getDefaultSharedPreferences(Showpic_resumeActivity.this);
SharedPreferences.Editor editor = app_preferences.edit();
String imageview_re = imageView1.getContext().toString();
editor.putString("key6", imageview_re);
Intent intentcamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "IMG_" + timeStamp + ".jpg";
File f = new File(Environment.getExternalStorageDirectory(), "DCIM/Camera/" + imageFileName);
uri = Uri.fromFile(f);
intentcamera.putExtra(MediaStore.EXTRA_OUTPUT, uri);
startActivityForResult(Intent.createChooser(intentcamera, "Take a picture with"), REQUEST_CAMERA);
editor.commit();
Intent myIntent = new Intent(Showpic_resumeActivity.this,Showdata_result_resume.class);
startActivity(myIntent);
}
});
这是我想要的结果
SharedPreferences app_preferences = PreferenceManager.getDefaultSharedPreferences(this);
String imgview_resume = app_preferences.getString("key6", "null");
imageresume.set(imgview_resume);
我有错误这一行 imageresume.set(imgview_resume); 我应该使用 .set 吗?