在Realm.deleteRealm(realm.getConfiguration());添加realm.close()如下之前,它就像一个魅力
Realm.deleteRealm(realm.getConfiguration());
realm.close()
try { realm.close() Realm.deleteRealm(realm.getConfiguration()); //Realm file has been deleted. } catch (Exception ex){ ex.printStackTrace(); //No Realm file to remove. }