I saved a path of an image taken by the camera into sqlite DB as the following:
retrievePath() method is to retrieve the saved path from the DB.
getImageUri(imgPath) method is to cobvert the file path into uri.
OnClickListener btn_TakePictureListener = new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File imgPath = retrievePath();
intent.putExtra(MediaStore.EXTRA_OUTPUT, getImageUri(imgPath));
startActivityForResult(intent, RequestCode);
}
};
private File retrievePath() {
int []x = imgOpHlpr.getIDs();
String s = imgOpHlpr.getImg_Path(x.length);
File file = new File(s);
Toast.makeText(getApplicationContext(), "retrieved path "+s.toString(),
Toast.LENGTH_LONG).show();
return file;
}
private Uri getImageUri(File path) {
Uri imgFileUri = Uri.fromFile(path);
return imgFileUri;
}
and what i want to know now is: after retrieving the path from the DB, how to display the contents of that path in an imageView. in other words, ofcourse the path of the image contains data, i want to display the contented data inside an ImageView.
How to do so?
you can use