// Find the last picture
String[] projection = new String[]{
MediaStore.Images.ImageColumns._ID,
MediaStore.Images.ImageColumns.DATA,
MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME,
MediaStore.Images.ImageColumns.DATE_TAKEN,
MediaStore.Images.ImageColumns.MIME_TYPE
};
final Cursor cursor = getContext().getContentResolver()
.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null,
null, MediaStore.Images.ImageColumns.DATE_TAKEN + " DESC");
// Put it in the image view
if (cursor.moveToFirst()) {
final ImageView imageView = (ImageView) findViewById(R.id.pictureView);
String imageLocation = cursor.getString(1);
File imageFile = new File(imageLocation);
if (imageFile.exists()) { // TODO: is there a better way to do this?
Bitmap bm = BitmapFactory.decodeFile(imageLocation);
imageView.setImageBitmap(bm);
}
}
मैं अभी भी एमएमएस हिस्सा भेजने पर काम कर रहा हूँ चाहता हूँ।
मुझे पता है कि यह काफी नहीं है जो आप पूछ रहे हैं, लेकिन हो सकता है कि आप इसका क्या मतलब हो? आप कैमरे की गतिविधि शुरू कर सकते हैं और परिणामस्वरूप उपयोगकर्ता को वह तस्वीर मिल सकती है। यहां देखें http://stackoverflow.com/questions/2314958/using-the-camera-activity-in-android – Craigy