views:

75

answers:

3

hi friends i identified problem in changing one activity using tab, in on tab activity i am adding data to sqlite in other tab activity i am displaying them using listview(array adapter) but when i come back to add data and after adding new item to sqlite the newly added records are not updated in listview

plz forward u r valuable suggestions to solve my problem

A: 

You seem to be pulling the list data from a DB. Is there a reason why you are using an ArrayAdapter instead of a CursorAdapter?

Anyway, you should call notifyDataSetChanged() on your list adapter when the data has changed so it can refresh the view.

codinguser
hi friend the problem is the activity still in active mode, when i coming to that activity it not calling it any of its life cycle methods like oncreate, onrestart so method code is not activating at all
Ramesh Bugatha
A: 

you can add code to update your listview (via notifyDataSetChanged or some such) by overriding the onResume() method in your activity which is called whenever the activity is brought back to the foreground. See http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle

QRohlf
A: 

Hi, I am new to android just have about less than a month of experiance in android.

i have implemented app in which i am using tab and i have used one tab to display list of items available in menu and and on the second tab the relative menu description will be available but i ahve do ne that is statically..

can you help me how i can store that value in database in fetch in second tab.

Thanks

Rakesh Gondaliya
@rakesh-gondaliya - welcome to Stack Overflow. This is not an answer to the question; if you have a question of your own, please create a new question.
McDowell