I am facing a problem with regards to the grid view update.. My Grid View will contain all the words found by the user.. The records will only be shown when you exit the app.. When I open my app, it contains the updated list view... What should I do here...
I am looking for the possibility of using the notifyDataSetChanged()
, but I don't know how to do it and where to put it... Anyone knows about this?
Here is my code of showing data in gridview..
//sliding menu onChange
@Override
public void onContentChanged()
{
super.onContentChanged();
mOpenButton = (Button) findViewById( R.id.button_open );
mDrawer = (MultiDirectionSlidingDrawer) findViewById( R.id.drawer);
GridView gridview = (GridView) findViewById(R.id.gridView1);
WordGuessedHandler guessed = new WordGuessedHandler(this);
List <WordGuessed> guessedList = guessed.getAllWordGuessed();
List<String> wordsList = new ArrayList<String>();
for(WordGuessed wg:guessedList){
wordsList.add(wg.getWord());
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, wordsList);
gridview.setAdapter(adapter);
}