나는 sqlite 데이터베이스에 몇 가지 목표를 저장하는 안드로이드 응용 프로그램을 만들고 있습니다. 또한 새로운 콘텐츠가있는 경우 온라인 mysql 데이터베이스에서 해당 내용을 가져옵니다.Async를 사용하는 동안 건너 뛴 프레임
그래서 주 활동이 시작되면 목록보기에서 sqlite db의 저장된 데이터를로드 한 다음 Volley로 JsonObjectRequest를 수행합니다. (비동기 작업)
그러나, 주요 활동을
Skipped 88 frames! The application may be doing too much work on its main thread.
Skipped 34 frames! The application may be doing too much work on its main thread.
88 프레임 SQLite는 데이터베이스입니다 시작 저장된 모든 데이터를로드 할 때 여전히 나는 다음과 같은 오류를 받고 있어요. 새로 고침을 위해 아래로 쓸어 넘기므로 JsonObjectRequest를 수행하면 34 프레임과 같은 오류가 발생합니다.
AsyncTask에도 sqlite db를로드해야 할 수도 있습니까? 아니면 다른 해결책이 있습니까?
의견을 듣고 싶습니다. 미리 감사드립니다.
Wiljan
편집 :
지금과 같은 비동기에 넣어 :
private class syncData extends AsyncTask<Void, Void, Void> {
private KerntaakListAdapter adapter;
public syncData(KerntaakListAdapter adapter) {
this.adapter = adapter;
}
/**
* The system calls this to perform work in a worker thread and
* delivers it the parameters given to AsyncTask.execute()
*/
@Override
protected Void doInBackground(Void... params) {
dataSource.syncData(swipeRefreshLayout);
return null;
}
/**
* The system calls this to perform work in the UI thread and delivers
* the result from doInBackground()
*/
protected void onPostExecute(String result) {
adapter.notifyDataSetChanged();
}
}
을 그리고이 그것을 트리거 :
new syncData(adapter).execute();
그러나 아직도 날 수 있습니다 건너 뛴 프레임 오류. 프레임이 조금 줄어들지 만 ..
그래서 별도의 스레드에서 데이터베이스를 읽어야합니다. 하지만 앱에 액자가 생기는 다른 것들이있을 수 있습니다. – Eenvincible