My Manifest activity code
<activity android:name="FileReceiver" > <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/*" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.SEND_MULTIPLE" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/*" /> </intent-filter> </activity> My Activity code :
Intent i = getIntent(); String action = i.getAction(); if (action.equals(Intent.ACTION_SEND)) { Uri imageUri = (Uri) i.getParcelableExtra(Intent.EXTRA_STREAM); if (imageUri != null) { Log.i("1234567", "URI : " + imageUri); Log.i("123456", "path :" + imageUri.getPath()); File source = null; source = new File(imageUri.getPath()); String fileNme = "/" + source.getName(); File destination = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + path); Log.i("123456", "destination path :" + destination); try { FileUtils.copyFile(source, destination); } catch (IOException e) { Log.i("123456", "IO Exception"); e.printStackTrace(); } } im getting exception
01-09 16:10:09.756: W/System.err(30225): java.io.FileNotFoundException: Source 'content:/media/external/images/media/127' does not exist how do i get the path of the image when i receive an image from DCIM folder ?