How can i update my listview, every time i add images to sdcard it's not showing I need to run my app again to see the pictures. Can you please help me thanks.
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.acmain);
sharedpreferences = this.getSharedPreferences(MyPREFERENCES,
Context.MODE_PRIVATE);
frameChooserGV = (ListView) findViewById(R.id.listview);
utils = new UtilsList(ListViewImage.this.getApplicationContext());
InitializeGridLayout();
framePaths = utils.getFilePaths();
frameChooserAdapter = new ListViewImageAdapter(
ListViewImage.this.getApplicationContext(), framePaths,
columnWidth);
frameChooserAdapter.notifyDataSetChanged();
frameChooserGV.setAdapter(frameChooserAdapter);
frameChooserGV.setOnItemClickListener(this);
}
public void InitializeGridLayout() {
Resources r = getResources();
float padding = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
AppConstant.GRID_PADDING, r.getDisplayMetrics());
columnWidth = (int) ((utils.getScreenWidth() - ((AppConstant.NUM_OF_COLUMNS + 1) * padding)) / AppConstant.NUM_OF_COLUMNS);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
// TODO Auto-generated method stub
Log.e("" + frameChooserGV.getPositionForView(view), "" + position);
Intent b_intent = new Intent(getApplicationContext(),
com.example.customize.CustomizeNumberDisplay.class);
b_intent.putExtra("position", position);
startActivity(b_intent);
}