私はAsyncTaskでそれらを更新するためにいくつかのデータ&を取得しようとしています。 非同期タスクでレルムインスタンスを更新していても、Realm access from incorrect thread. Realm objects can only be accessed on the thread they were created.
というエラーが発生します。
は、ここに私のコードです:別のインスタンスを取得した場合でも、icorrectスレッドからのrealmアクセス
new AsyncTask<Void, Void, Void>(){
@Override
protected Void doInBackground(Void... params) {
mRealm = Realm.getDefaultInstance();
// my queries & updates
return null;
}
}.execute();
スタックトレースが不平を言っているコードを投稿し、問題の行を指してください。 –