Post Reply Subscribe to Thread Email Thread

android how to remove black frame of a deleted image in the sd card folder after dele

15th June 2014, 02:30 PM |#1  
OP Junior Member
Thanks Meter: 0
1 posts
Join Date:Joined: Jun 2014
I am trying to delete an image file from sdcard.The following code works fine with the emulator but when I'm testing it on my Nexus phone there is a black frame exists in the folder for each deleted image.So, after following posts in relation to similar issue my code looks like below. I've just started learning android programming and got stuck at this point.I'll really appreciate your help
String sdcard_path=Environment.getExternalStorageDirector y().getAbsolutePath()+"/Expense_image";
File cacheFile =new File (sdcard_path,imageLocation);

boolean deleted=cacheFile.delete();

Log.i("Deletion check","deleted:"+deleted);
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory())));

<uses-feature android:name="" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_ST ORAGE" />

android:label="@string/app_name" >
<action android:name="com.refat.myexpensev1.DELETERECORD" />

<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.MEDIA_MOUNTED" />
<data android:scheme="file" />
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes