tags:

views:

55

answers:

2

I am experiencing a problem where when the android device wake up from sleep, the Activity would take forever to get redrawn(and have to terminate it most of the time). I am not sure why, but when I comment out the code below where it retrieves an object from the database based on id stored in the bundle, the problem goes away.
Not sure why the db transaction is causing an issue. any idea?
secondly, is it better to store the object in bundle instead of storing its id and retrieving it from db in onCreate?

 public void onCreate(Bundle bundle) {    
        super.onCreate(bundle);
        setContentView(R.layout.track_act);
     /*
        final Bundle extras=getIntent().getExtras();
        long actId=extras.getLong("activity_id");
        System.err.println("actId is "+actId);
        Data.Activity act=DBManager.getActivity(actId, this);
    */
}
A: 

I don't know Android, so this is just a shot in the dark (feel free to downvote) but maybe you could catch the wakeup from sleep by watching the time (there may be an event instead), and on wake up, reinitialize the app, or just skip over the transaction.

lod3n
A: 

Are you getting nothing in LogCat related to this problem?

It looks like your getActivity method is a static method. Could there be some problems associated with that static reference after waking up from sleep?

JRL