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

Sending SMS from an application in android
Manifest Merger error when using Espresso to test a project with minSdkVersion=“14”
Writing to a File in Android
Android send udp broadcast silently fails
Best way to pass a SurfaceView to android.media.MediaPlayer
Android : How to set edittext text just in first touch after activity launch
Battery charging
SMS : Columns “_id” does not Exist
GetFragmentManager.findFragmentByTag() returns null
Can not set background for RelativeLayout?
Android activity finish() and onBackPressed
Android Studio sudden appearance of unresolved symbols after pulling from Git
How does Android Back Navigation works?
How to install google apps when android built from source
Cannot be resolved to type - Android
Android Programming: onPause() called, onSaveInstanceState(…) not

Categories

HOME
go
hyperlink
deep-learning
ng-idle
c99
components
apiblueprint
graphics
solver
owl-carousel
nuget
square
nuget-package
crystal-lang
opengl-3
accessibility
dkim
gson
appcelerator-studio
siddhi
line
opengl-es-3.0
xcodebuild
spring-social
speech-synthesis
favicon
pybossa
flash-player
scrolltop
docx
screen-readers
feathersjs
git-extensions
xmonad
foreign-keys
asp.net-core-webapi
user-experience
href
question2answer
ember-cli
angular-routing
game-theory
xcode-ui-testing
motion-detection
underscore.js
apktool
git-squash
login-script
pdw-file-browser
reason
lint
reactivekit
tex
filesystemwatcher
sim-card
diacritics
apriori
escpos
clang++
getchar
nanoc
sonarlint-eclipse
netbeans6.8
mongotemplate
magic-draw
opengl-4
mouseleave
cpu-cache
donations
mapinfo
ng-grid
gogs
vorpal.js
pre-build-event
project-organization
fuzzywuzzy
qbxml
piracy-prevention
xenomai
rubaxa-sortable
ember-cli-rails
lasso
botan
typeconverter
shopizer
rrule
dbaccess
iiop
cocos3d
machine-instruction
template-deduction
kissfft
rcaller
dct
dot42
radiant
vsx
drupal-nodes
syndicationfeed
xmltodict
rfc5322
artemis
scrypt
isqlquery
kogrid
traceability
onload-event
alice
bjyauthorize
android-loadermanager
tree-balancing
boost-msm
dajaxice
wiimote
relative
u2netdk
umra
http-daemon
unattended-processing
undefined-index
easyb
hbm2java
openfaces
sifr
burndowncharts
complex-event-processing
application-planning
contentpresenter
change-management

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