Remove All Ads from XDA

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

1 posts
Thanks Meter: 0
By, Junior Member on 15th June 2014, 03:30 PM
Post Reply Email Thread
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

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes