Android : Runtime Exception : An error occured while executing doInBackground()

on Saturday, January 31, 2015


I am getting the stacktrace error at runtime.



Runtime Exception : An error occured while executing doInBackground()


Fatal signal 6 (SIGABRT) at 0x0000162c (code=-6), thread 5676



I am posted the full stacktrace and pointed out the error line in below coding.


While loading the fragment page I am getting this log error.Suddenly application crashers.It has been happening in all devices.


Stacktrace:



01-30 05:05:57.213: E/dalvikvm(5676): VM aborting
01-30 05:05:57.213: A/libc(5676): Fatal signal 6 (SIGABRT) at 0x0000162c (code=-6), thread 5676 (e.quranmadeeasy)
01-30 05:05:57.761: D/dalvikvm(5767): GC_FOR_ALLOC freed 121K, 6% free 3345K/3524K, paused 2ms, total 2ms
01-30 05:05:57.761: I/dalvikvm-heap(5767): Grow heap (frag case) to 4.394MB for 1127532-byte allocation
01-30 05:05:57.761: D/dalvikvm(5767): GC_FOR_ALLOC freed <1K, 4% free 4446K/4628K, paused 2ms, total 2ms
01-30 05:05:57.805: W/dalvikvm(5767): threadid=12: thread exiting with uncaught exception (group=0xa4cc6b20)
01-30 05:05:57.805: W/dalvikvm(5767): threadid=15: thread exiting with uncaught exception (group=0xa4cc6b20)
01-30 05:05:57.805: I/Process(5767): Sending signal. PID: 5767 SIG: 9

01-30 05:05:57.805: E/AndroidRuntime(5767): FATAL EXCEPTION: AsyncTask #1
01-30 05:05:57.805: E/AndroidRuntime(5767): Process: com.qrme.quranmadeeasy, PID: 5767
01-30 05:05:57.805: E/AndroidRuntime(5767): java.lang.RuntimeException: An error occured while executing doInBackground()
01-30 05:05:57.805: E/AndroidRuntime(5767): at android.os.AsyncTask$3.done(AsyncTask.java:300)
01-30 05:05:57.805: E/AndroidRuntime(5767): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
01-30 05:05:57.805: E/AndroidRuntime(5767): at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
01-30 05:05:57.805: E/AndroidRuntime(5767): at java.util.concurrent.FutureTask.run(FutureTask.java:242)
01-30 05:05:57.805: E/AndroidRuntime(5767): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
01-30 05:05:57.805: E/AndroidRuntime(5767): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
01-30 05:05:57.805: E/AndroidRuntime(5767): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
01-30 05:05:57.805: E/AndroidRuntime(5767): at java.lang.Thread.run(Thread.java:841)
01-30 05:05:57.805: E/AndroidRuntime(5767): Caused by: java.lang.NullPointerException
01-30 05:05:57.805: E/AndroidRuntime(5767): at com.qrme.quranmadeeasy.LessonActivity$getLesson.doInBackground(LessonActivity.java:258)
01-30 05:05:57.805: E/AndroidRuntime(5767): at com.qrme.quranmadeeasy.LessonActivity$getLesson.doInBackground(LessonActivity.java:1)
01-30 05:05:57.805: E/AndroidRuntime(5767): at android.os.AsyncTask$2.call(AsyncTask.java:288)
01-30 05:05:57.805: E/AndroidRuntime(5767): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-30 05:05:57.805: E/AndroidRuntime(5767): ... 4 more


LessonActivity.java:



public class LessonActivity extends Activity implements OnItemClickListener {

static ArrayList<Lesson> lessonList =null ;
static ArrayList<Settings> settings = null;

@Override
protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
setContentView(R.layout.activity_lesson);
initialize();
listLesson.setOnItemClickListener(this);
}

@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();

new getLesson().execute("");
}

..............
..............

// Async Task for getting all lesson of a chapter

public class getLesson extends AsyncTask<String, Void, String> {

// ProgressDialog pd; // progress dialog declaration

@Override
protected String doInBackground(String... params) {

lessonList = DatabaseQueryHelper.getInstance().getLesson(chapterId); -->258th line

return null;
}

@Override
protected void onPreExecute() {
super.onPreExecute();

}

@Override
protected void onPostExecute(String result) {

if(lessonList!=null)
{
if(lessonList.size()>0)
{
al = new AdapterLesson(LessonActivity.this, lessonList);
listLesson.setAdapter(al);

}
}
}
}
}


Anyone can help me with this.Thank you.


0 comments:

Post a Comment