As i am Building bus time table app which inserts and displays result of query in a activity, each time i press back button and re launch this activity, the data is again entered and result of the query is duplicated. how to avoid this ? Also When inserting bulk insert data into table in sqlite my app freezes for a second or so, how to avoid this ? Can i use a progressbar ?
Asked
Active
Viewed 453 times
0
-
Can you post the relevant part of the code and logcat with the exception? – Szymon Mar 19 '14 at 02:34
1 Answers
0
You need to educate yourself on the Android Activity Lifecycle, so that you understand what is happening when you relaunch the activity. If you don't want the query to be rerun on activity start you need to handle recreating your app correctly.
Finally, for your bulk insert problem, if your app is freezing, that is an indication that you are doing the loading on the UI thread. You should be doing this using the LoaderManager and probably an AsyncTaskLoader to load this data off of the UI thread.

Nick Palmer
- 2,589
- 1
- 25
- 34