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
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
... 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
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
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);
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
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
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
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
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
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
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.,
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
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
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
15 matches
Mail list logo