Saving Data on Android


Dele/ng a file from internal storage



Download 19,28 Mb.
Pdf ko'rish
bet27/292
Sana24.01.2022
Hajmi19,28 Mb.
#407089
1   ...   23   24   25   26   27   28   29   30   ...   292
Bog'liq
Bailey J., Dominguez A., Djermanovic D. - Saving Data on Android (1st Edition) - 2019

Dele/ng a file from internal storage
Replace the existing 
return
 statement for the
deleteNote
 function in 
InternalFileRepository
 with the following line of code:
return
 noteFile(fileName).delete()
Saving Data on Android
Chapter 1: Using Files
raywenderlich.com
27


The 
delete
 function of the 
File
 class returns a 
Boolean
 value to indicate whether 
the delete operation was successful; this function returns that value to where it was 
called in 
MainActivity
.
Build and run the app. Delete a file by tapping the 
DELETE
 button; you’ll see the 
appropriate message.
To confirm the file was deleted, use the Device File Explorer or try to delete the file a 
second time. If everything worked as expected, you’ll see a message that indicates 
the file could not be deleted (because it’s already gone).
Internal storage is great for storing private data in an app. But what if you want to 
store data temporarily? To do this, you can use 

Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   23   24   25   26   27   28   29   30   ...   292




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish