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

Android source and AudioRecord multi-utilisation
Scan result QR condition
OrmLite can create table successfully but cause error after insert a record
WebRTC on Android Chrome beta in IMS network
Active MQ security and scalability
How can I get the same drawerLayout on multiple types of activities without using fragments?
custom spinner with last item as a link
How can I interface an Android app with SQL Server?
How to compile android goldfish 3.4 kernel on 32-bit linux
Change OnMylocationButtonClick zoom in Google Maps v2 Android
How Android ListView add item don't use notifyDataSetChanged?
GreenDroid ActionBar error
ARM NEON optimization for image processing, diagonal 2 tap filter
How to add a line at the bottom of spinner as like edittext in android
android:Elevation not respected across FragmentTransactions
Retrieve memory of Bitmap/Drawable

Categories

HOME
localization
c99
css3
depth
angular2-material
zend-framework
replace
visual-studio-emulator
spring-session
missing-data
opengl-3
startup
powershell-v5.0
template-engine
replication
asciidoctor-pdf
poedit
imagemap
dpdk
flask-sqlalchemy
dynamically-generated
beta
xunit
itunes
progress-bar
fractions
winpe
userdefaults
hibernate-validator
contacts
dynamic-jasper
pdw-file-browser
wurfl
watchman
opensmpp
comparison-operators
movilizer
ssrs-2014
flask-login
uiimage
snapchat
fwrite
jboss-4.2.x
dtsearch
x-ray
stdmap
truezip
oozie-coordinator
java-websocket
flac
renaming
pocketsphinx-android
rmongo
polyline
usart
macaulay2
mta
kango-framework
maybe
character-replacement
boomerang
gocql
rewrite
jdi
pax-exam
iced-coffeescript
sql-server-data-tools
user-permissions
broadband
qtwebengine
ejb-2.x
webmatrix-3
android-cookiemanager
mruby
imagefilter
cbind
lnk
functional-java
extjs2
sbcl
xmltodict
android-usb
unit-of-work
flex++
joomla-template
pagedown
curb
panda3d
fragmenttransaction
qtconcurrent
dajaxice
jdb
httponly
wiimote
pinch
u2netdk
uipagecontrol
xui
dataform
qglwidget
luajava
jqueryform
isapi-extension
mathematical-notation
dsoframer
soappy

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