Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use this method to store the image and display it.This is used to store the image</p> <pre><code> //create new directory to store image File photo = new File(Environment.getExternalStorageDirectory()+"/Android/data/"+getApplicationContext().getPackageName()+"/files/Receipt"); boolean success = false; if(!photo.exists()) { success = photo.mkdirs(); } //if exists save the image in specified path if(!success) { dbimgguid = UUID.randomUUID(); imagename =dbimgguid.toString(); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); photo = new File(Environment.getExternalStorageDirectory()+"/Android/data/"+getApplicationContext().getPackageName()+"/files/Receipt", imagename+".png"); intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(photo)); imageurl = Uri.fromFile(photo); startActivityForResult(intent, CAMERA_RECEIPTREQUEST); } </code></pre> <p>To view the image</p> <pre><code> @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch(requestCode) { case CAMERA_RECEIPTREQUEST: if(resultCode== Activity.RESULT_OK) { //Toast.makeText(this, "Receipt Image Saved", Toast.LENGTH_SHORT).show(); BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 8; ImageView jpgView = (ImageView)findViewById(R.id.imageView1); Bitmap receipt = BitmapFactory.decodeFile(photo.toString(),options); jpgView.setImageBitmap(receipt); } break; } </code></pre> <p>I hope this will help you.. }</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload