android - How to force a content provider to reset when manually deleting database -


in app have contentprovider attached table in database cursorloader fills listview in 1 of activities. table filled empty default , gets filled user input data. want allow user delete of stored data , i'm deleting entire database when option selected. database recreated in it's default state when user starts using app again, first time used app.

my issue when delete database, contentprovider doesn't detect database deleted , when go listview activity, list still there. i'm making app reload listview activity instead of resuming memory , list still there though database empty. way can contentprovider reload kill app in system settings , open again.

is there way forcefully restart contentprovider or tell data has been updated outside of contentprovider class itself?

you can use delete method of content provider without defining selection:

context.getcontentresolver().delete(yourprovider.content_uri, null, null); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -