0

I have an app widget that does some stuff in AsyncTask's doInBackground() method and the final steps are to get the list of store names, that looks like this:

Store storeObject=store.getStores().getItems().get(0).getStore();
String name= storeObject.getName();
//name of the store         
return name;

Right now I am getting the name at 0th position. Now I want all the names of the stores (that are 27 in my code being fetched) in my widget text view one by one when you click a next button.

So how should I pass this name in my remote views back in onPostExecute() of AsyncTask.

updateViews.setTextViewText(R.id.text_view, name);
updateViews.setOnClickPendingIntent(R.id.next, pendingIntent);

Where should I use a for loop? in doInBackground or onPostExcecute or both? How can I use loop in remoteviews and update it? Please please help. I am a newbie.

Atihska
  • 4,803
  • 10
  • 56
  • 98

1 Answers1

0

I got it. Its a list so I generated an index that's randomly updated, no need of loop.

Atihska
  • 4,803
  • 10
  • 56
  • 98