I found solution as,
First of all I referred Refresh/Reload database reference in custom ContentProvider after restore but not satisfied with answer because its just for closing database.
So I have created my answer as below:
DBHelper.java
/**
* Delete database
*/
public static void reCreateDatabase(Context mContext) {
ContentResolver resolver = mContext.getContentResolver();
ContentProviderClient client = resolver.acquireContentProviderClient(KOOPSContentProvider.AUTHORITY);
assert client != null;
KOOPSContentProvider provider = (KOOPSContentProvider) client.getLocalContentProvider();
assert provider != null;
provider.resetDatabase();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
client.close();
else
client.release();
LOGD("Database Deleted...");
}
public void removeDatabase(Context mContext) {
mContext.deleteDatabase(DATABASE_NAME);
LOGD("Database Deleted...");
}
KOOPSContentProvider.java
public void resetDatabase() {
if(dbHelper != null) {
dbHelper.removeDatabase(getContext());
dbHelper = new DbHelper(getContext());
} else {
LOGD("Database NULL");
}
}
USE As:
DbHelper.reCreateDatabase(mContext);
Thank you :) :)