{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-java/issues/3189","repository_url":"https://api.github.com/repos/realm/realm-java","labels_url":"https://api.github.com/repos/realm/realm-java/issues/3189/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/3189/comments","events_url":"https://api.github.com/repos/realm/realm-java/issues/3189/events","html_url":"https://github.com/realm/realm-java/issues/3189","id":165731095,"number":3189,"title":"Realm automatically remove my database content","user":{"login":"tux-world","id":6617583,"avatar_url":"https://avatars.githubusercontent.com/u/6617583?v=3","gravatar_id":"","url":"https://api.github.com/users/tux-world","html_url":"https://github.com/tux-world","followers_url":"https://api.github.com/users/tux-world/followers","following_url":"https://api.github.com/users/tux-world/following{/other_user}","gists_url":"https://api.github.com/users/tux-world/gists{/gist_id}","starred_url":"https://api.github.com/users/tux-world/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tux-world/subscriptions","organizations_url":"https://api.github.com/users/tux-world/orgs","repos_url":"https://api.github.com/users/tux-world/repos","events_url":"https://api.github.com/users/tux-world/events{/privacy}","received_events_url":"https://api.github.com/users/tux-world/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-java/labels/S:Waiting%20For%20User","name":"S:Waiting For User","color":"ededed"},{"url":"https://api.github.com/repos/realm/realm-java/labels/T:Help","name":"T:Help","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-15T07:55:04Z","updated_at":"2016-07-17T12:05:25Z","closed_at":null,"body":"I dont know why after some running android application my data in database is lost, and i dont have any data in database :(\r\n\r\nmy solution for using Realm and close database in all Android activities of fragments is:\r\n\r\n    @Override\r\n    protected void onCreate(@Nullable final Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_market_detail);\r\n        realm                            = Realm.getDefaultInstance();\r\n     }\r\n\r\n    @Override\r\n    protected void onResume() {\r\n        super.onResume();\r\n        if (realm.isClosed())\r\n            realm = Realm.getDefaultInstance();\r\n    }\r\n\r\n    @Override\r\n    protected void onDestroy() {\r\n        super.onDestroy();\r\n        if (!realm.isClosed())\r\n            realm.close();\r\n    }\r\n\r\ni dont have any ```realm.deleteAll();``` in my source code\r\n\r\nRealm configuration in class which extended from Application\r\n\r\n        byte[] key = new byte[64];\r\n        new SecureRandom().nextBytes(key);\r\n        RealmConfiguration realmConfiguration = new RealmConfiguration\r\n                .Builder(this)\r\n                .name(\"SignalApplication.db\")\r\n                .deleteRealmIfMigrationNeeded()\r\n                .build();\r\n\r\n        Realm.setDefaultConfiguration(realmConfiguration);"},"comment":{"url":"https://api.github.com/repos/realm/realm-java/issues/comments/233178820","html_url":"https://github.com/realm/realm-java/issues/3189#issuecomment-233178820","issue_url":"https://api.github.com/repos/realm/realm-java/issues/3189","id":233178820,"user":{"login":"tux-world","id":6617583,"avatar_url":"https://avatars.githubusercontent.com/u/6617583?v=3","gravatar_id":"","url":"https://api.github.com/users/tux-world","html_url":"https://github.com/tux-world","followers_url":"https://api.github.com/users/tux-world/followers","following_url":"https://api.github.com/users/tux-world/following{/other_user}","gists_url":"https://api.github.com/users/tux-world/gists{/gist_id}","starred_url":"https://api.github.com/users/tux-world/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tux-world/subscriptions","organizations_url":"https://api.github.com/users/tux-world/orgs","repos_url":"https://api.github.com/users/tux-world/repos","events_url":"https://api.github.com/users/tux-world/events{/privacy}","received_events_url":"https://api.github.com/users/tux-world/received_events","type":"User","site_admin":false},"created_at":"2016-07-17T12:05:25Z","updated_at":"2016-07-17T12:05:25Z","body":"@Zhuinden Thanks. problem resolved"}}
{"actor":{"display_login":"tux-world"}}