Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to display my pic into my own frame after taking snap from my camera
    text
    copied!<p>Here is my code, it's using the camera and those snaps are stored into the SD card, this is working perfectly. Now I need to get those snaps back into my own frame. How do I do that, suggestion anyone?</p> <pre><code>import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.view.View; import android.widget.ImageView; public class CampicsaveActivity extends Activity { /** Called when the activity is first created. */ ImageView iv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.camdemo); iv=(ImageView)findViewById(R.id.imageView1); iv.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { saveImage(0); } }); } public void saveImage(int IMAGE_CAPTURE) { try { FileOutputStream fos = openFileOutput( "MyFile.jpeg", Context.MODE_WORLD_WRITEABLE); fos.close(); File f = new File(getFilesDir() + File.separator + "MyFile.jpeg"); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f)); intent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION,90); startActivityForResult(intent,IMAGE_CAPTURE); startActivityForResult(new Intent( MediaStore.ACTION_IMAGE_CAPTURE).putExtra( MediaStore.EXTRA_OUTPUT, Uri.fromFile(f)),IMAGE_CAPTURE); } catch(IOException e) { } } } </code></pre> <p>Here is my camera.xml</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/kk" /&gt; &lt;/LinearLayout&gt; </code></pre>
 

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