I am trying to do something really simple, but somehow not getting the direction. Here is what I am trying to accomplish.
In my GridView activity, I am loading up to 10 photos from an sdcard location. Then, using a menu option “Load more”, I would like to load up to 50 photos from another sdcard location and refresh the GridView to display all photos (don’t want to call GridView activity again with the new items)
Refreshing GridView (which is defined in the main UI thread) from an outside thread or menu triggered option is what I am looking to do. Any suggestions will be appreciated.
Your only and most proper optıon ıs that you define a Refresh option in the menu and then trigger an
AsyncTaskwhich will handle the background operation and after that updating the Ui with the result.Check AsyncTask for more info.
http://developer.android.com/resources/articles/painless-threading.html