--- android/People/src/com/grundfos/android/people/PeopleList.java 2009/08/05 08:53:33 230 +++ android/People/src/com/grundfos/android/people/PeopleList.java 2009/08/05 09:44:11 231 @@ -1,12 +1,12 @@ package com.grundfos.android.people; -import java.io.File; import java.util.Date; import android.app.AlertDialog; import android.app.Dialog; import android.app.ListActivity; import android.app.ProgressDialog; +import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; @@ -14,6 +14,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Message; +import android.os.PowerManager; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; @@ -232,14 +233,22 @@ Runnable reloadDB = new Runnable() { public void run() { + PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); + PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag"); try { + + wl.acquire(); + + peopleDB.loadData(progressHandler); dbUpdateHandler.sendEmptyMessage(DOWNLOAD_SUCCESS); } catch (Exception e) { Log.e("PeopleList", "reloadDB", e); dbUpdateHandler.sendEmptyMessage(DOWNLOAD_FAILED); - } + } finally { + wl.release(); + } } }; } \ No newline at end of file