문제

Im a bit confused about which operations have to be executed in background thread:

Cursor curserU = myDataBase.rawQuery("some query");
startManagingCursor(curserU);
curserU.moveToFirst();
curserU.someFuctionWhichWillReturnData();

is it enough if only this line runs in background:

      Cursor curserU = myDataBase.rawQuery("some query");

or does everything have to beinbackground?

도움이 되었습니까?

해결책

Putting rawQuery() into background thread is enough. When you are passing Cursor into SimpleCursorAdapter for example, it operates on Cursor on UI thread. But consider using CursorLoader as startManagingCursor() is marked as deprecated.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top