/[projects]/android/People/src/com/grundfos/android/people/PeopleList.java
ViewVC logotype

Diff of /android/People/src/com/grundfos/android/people/PeopleList.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 230 by torben, Wed Aug 5 08:53:33 2009 UTC revision 231 by torben, Wed Aug 5 09:44:11 2009 UTC
# Line 1  Line 1 
1  package com.grundfos.android.people;  package com.grundfos.android.people;
2    
 import java.io.File;  
3  import java.util.Date;  import java.util.Date;
4    
5  import android.app.AlertDialog;  import android.app.AlertDialog;
6  import android.app.Dialog;  import android.app.Dialog;
7  import android.app.ListActivity;  import android.app.ListActivity;
8  import android.app.ProgressDialog;  import android.app.ProgressDialog;
9    import android.content.Context;
10  import android.content.DialogInterface;  import android.content.DialogInterface;
11  import android.content.Intent;  import android.content.Intent;
12  import android.content.SharedPreferences;  import android.content.SharedPreferences;
# Line 14  import android.database.Cursor; Line 14  import android.database.Cursor;
14  import android.os.Bundle;  import android.os.Bundle;
15  import android.os.Handler;  import android.os.Handler;
16  import android.os.Message;  import android.os.Message;
17    import android.os.PowerManager;
18  import android.text.Editable;  import android.text.Editable;
19  import android.text.TextWatcher;  import android.text.TextWatcher;
20  import android.util.Log;  import android.util.Log;
# Line 232  public class PeopleList extends ListActi Line 233  public class PeopleList extends ListActi
233    
234      Runnable reloadDB = new Runnable() {      Runnable reloadDB = new Runnable() {
235                  public void run() {                  public void run() {
236                            PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
237                            PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
238                          try                          try
239                          {                          {
240    
241                                     wl.acquire();
242    
243    
244                                  peopleDB.loadData(progressHandler);                                  peopleDB.loadData(progressHandler);
245                          dbUpdateHandler.sendEmptyMessage(DOWNLOAD_SUCCESS);                          dbUpdateHandler.sendEmptyMessage(DOWNLOAD_SUCCESS);
246                          } catch (Exception e) {                          } catch (Exception e) {
247                                  Log.e("PeopleList", "reloadDB", e);                                  Log.e("PeopleList", "reloadDB", e);
248                                  dbUpdateHandler.sendEmptyMessage(DOWNLOAD_FAILED);                                  dbUpdateHandler.sendEmptyMessage(DOWNLOAD_FAILED);
249                          }                                        } finally {
250                                     wl.release();
251                            }
252                  }                  }
253      };      };
254  }  }

Legend:
Removed from v.230  
changed lines
  Added in v.231

  ViewVC Help
Powered by ViewVC 1.1.20