android


how can i delete a folder on app deletion which was made by app outside the appfolder


I made an application from which I make a folder and save some files in it.
What I want is, when I delete the application the folder that I make outside from application should be deleted.
Add your manifest following permission
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
Then java code
File dir = getActivity().getFilesDir();
if (dir.isDirectory())
{
String[] subDir = dir.list();
for (int i = 0; i < subDir.length;i++)
{
new File(dir, subDir[i]).delete();
}
}
Follow this link to listen to when your application is being uninstalled, and in the callback, delete the folder using #sasikumar's code below. Hope this helps.

Related Links

if-else boolean type not working In Android
pulling drawer layout from icon at the bottom
Phonegap 3.3 installation issues
MVVMCross (WP8, Android, iPhone) + Azure Mobile Service
Swipe/drag Android view from the bottom of the screen
How to check if current user is logged in android
How to stop location update for the ads that uses location service
Show a pop-up dialog at the end of the game on SurfaceView
java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
Video library for android device
Reach an element from different class
Can't create project with Google Map android API V2
Android Ovelay Button Call Popup Window but my pop up window can't close
How can I change the “font-family” css style inside WebView after html is loaded
Using database into Swipe view
Why does my code not work on a device, but work on the emulator?

Categories

HOME
android
windows
sonarqube
kentico
alexa-skills-kit
mysql-workbench
toolbox
recordrtc
android-securityexception
symmetricds
null-pointer
git-extensions
swagger-2.0
drive
undertow
angular-routing
appirater
has-and-belongs-to-many
linked-data
inversion-of-control
testcomplete
finagle
ntp
constexpr
autodesk-designautomation
python-2.6
kudu
sql-server-2000
kodi
hreflang
gojs
openwhisk
getpixel
sql-delete
apic
reason
google-knowledge-graph
wurfl
playframework-2.1
tex
apriori
facebook-social-plugins
fwrite
ovf
ntvs
twilio-click-to-call
wpas
truezip
colorbar
check-mk
flyout
structuremap4
vcloud-director-rest-api
iotivity
tracker-enabled-dbcontext
sklearn-pandas
crouton-os
directdraw
decimalformat
grgit
lazybones
xvim
cgi-bin
keyup
node-serialport
delayed-execution
webmatrix-3
contrast
rickshaw
appserver
named-parameters
kissfft
lnk
malformedurlexception
functional-java
dot42
synapse
android-usb
jeromq
cocoalibspotify-2.0
nebula
facebook-timeline
fb.ui
appjs
apache-whirr
mapping-by-code
hibernateexception
luabind
pinch
user-tracking
jquery-tools
luajava
interprocess
opml
data-mapping

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App