[android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread lbendlin
refresh your list adapter via notifySataSetChanged() in onResume() -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to

[android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread Abhishek Akhani
override onResume() method of your activity and write your code to refresh the listview in onResume()... it will be called when you reopen the application after pressing home button... -- You received this message because you are subscribed to the Google Groups Android Developers group. To

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread Kostya Vasilyev
... or make your cursor managed, by giving it to Acitivity.startManagingCursor. Managed cursors are automatically automatically requeried around the time of onResume / onStart. 03.08.2011 21:50, lbendlin пишет: refresh your list adapter via notifySataSetChanged() in onResume() -- Kostya

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread usafrmajor
already doing this. :-( -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com

[android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread usafrmajor
Can someone give me an example of what the onResume() should look like. I did this and my app crashes @Override public void onResume() { lv_adapter.notifyDataSetChanged(); } this is in the onCreate above super.onCreate(savedInstanceState);

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread Kostya Vasilyev
Are you actually calling onRestart / onStart / onResume / onPause from your own code inside onCreate? 03.08.2011 22:33, usafrmajor пишет: super.onCreate(savedInstanceState); setContentView(R.layout.main_selected); onRestart(); onStart(); onResume(); onPause(); -- Kostya Vasilyev -- You

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread usafrmajor
As you might imagine I am new to all this. :-) But the answer is yes and no. I have been adding and commenting various combinations of those as I try to figure out how to fix my problem. Kind of lost track that there are in an onCreate method. Seems obvious now that they should not be

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread Kostya Vasilyev
03.08.2011 22:52, usafrmajor пишет: As you might imagine I am new to all this. :-) I'd never guessed :) But the answer is yes and no. I have been adding and commenting various combinations of those as I try to figure out how to fix my problem. Kind of lost track that there are in an

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread usafrmajor
I close the db adapter but not the cursor -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread Kostya Vasilyev
There is no close method in ListAdapter http://developer.android.com/reference/android/widget/ListAdapter.html If you are closing the cursor - well, a closed cursor won't requery. It's closed. -- Kostya 03.08.2011 23:33, usafrmajor пишет: I close the db adapter but not the cursor -- You

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread usafrmajor
I was referring to the database connection that populates the cursor NOT the ListAdapter DBAdapter db = new DBAdapter(this); And, I do not close the cursor explicitly unless closing the DBAdapter [i.e., db.close();] after doing setListAdapter does it? -- You received this message because you

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread Kostya Vasilyev
What's DBAdapter? A subclass of SQLiteOpenHelper? 04.08.2011 0:16, usafrmajor пишет: I was referring to the database connection that populates the cursor NOT the ListAdapter DBAdapter db = new DBAdapter(this); And, I do not close the cursor explicitly unless closing the DBAdapter [i.e.,

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread usafrmajor
It is the class that I created that interacts with a database table. It does the inserts, updates, deleted and selects from the db table. It uses these classes import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread Kostya Vasilyev
If you're closing the SQLiteOpenHelper, it means you're closing the database. A closed database is just that, closed, and will need to be reopened - e.g. in onRestart. You will also need to run a new query, to get a fresh -- open -- cursor that you can work with. A better way is to keep the

Re: [android-developers] Re: Refreshing ListView After Home Key is Pressed and Returning to App

2011-08-03 Thread usafrmajor
OK, I'll work on that. Thanks for all your help. :-) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to