Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I store the imagePath of the image that I took using the camera activity into the database and retrieving the path?
    primarykey
    data
    text
    <p><br> how to store the imagePath of the image that I had captured using the camera activity to database. I also need to retrieve that imagePath and display on another activity? <br> Can someone help me please? </p> <p><em>Update:</em></p> <pre><code>public class Image_secondPage extends Activity { public static final int CAMERA_RESULT = 1; Button btn1; ImageView imageView1; private final String tag = getClass().getName(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.image_secondpage); imageView1 = (ImageView)findViewById(R.id.imageView1); Button btnNext = (Button)findViewById(R.id.buttonNext); btnNext.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Image_secondPage.this, ImagesPage.class); startActivity(intent); } }); PackageManager pm = getPackageManager(); if(pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) { Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); i.putExtra(MediaStore.EXTRA_OUTPUT, MyFileContentProvider.CONTENT_URI); startActivityForResult(i, CAMERA_RESULT); } else { Toast.makeText(getBaseContext(), "Camera is not available", Toast.LENGTH_LONG).show(); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.i(tag, "Receive the camera result"); if(resultCode == RESULT_OK &amp;&amp; requestCode == CAMERA_RESULT) { File out = new File(getFilesDir(), "newImage.jpg"); if(!out.exists()) { Toast.makeText(getBaseContext(), "Error while capturing image", Toast.LENGTH_LONG).show(); return; } Bitmap mBitmap = BitmapFactory.decodeFile(out.getAbsolutePath()); imageView1.setImageBitmap(mBitmap); } } @Override protected void onDestroy() { super.onDestroy(); imageView1 = null; } </code></pre> <p>I am supposed to get the imagePath that I have captured and show the image on the imageView that I had on the next class but I don't know how. Can someone help me?</p>
    singulars
    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.
 

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