¡@

Home 

2014/10/16 ¤W¤È 08:09:29

android Programming Glossary: additem

Updating the list view when the adapter data changes

http://stackoverflow.com/questions/4198425/updating-the-list-view-when-the-adapter-data-changes

mMyListView.setAdapter new ArrayAdapter String this android.R.layout.simple_list_item_1 listItems public void addItem View v listItems.add list Item mMyListView.invalidate Layout used xml version 1.0 encoding utf 8 LinearLayout xmlns android.. wrap_content android layout_height wrap_content android id @ id AddItemsButton android text Add Items android onClick addItem Button LinearLayout android share improve this question substitute mMyListView.invalidate for BaseAdapter mMyListView.getAdapter..

Custom SimpleAdapter only shows Sample Text Android

http://stackoverflow.com/questions/6916584/custom-simpleadapter-only-shows-sample-text-android

rw1.setText map.get position return row to add the item put it in the map and add the map into the list private void addItem HashMap String String map new HashMap String String map.put row_1 row1 map.put row_2 row2 map.put row_3 painLevelString.. EDIT Added Code This is how I am getting the data from the intent onActivityResult placed before the addItem Code protected void onActivityResult int requestCode int resultCode Intent data if resultCode 1 row1 data.getStringExtra.. data.getStringExtra com.painLogger.painTime textTreatmentString data .getStringExtra com.painLogger.treatment addItem Also just in case this is relevant the order of placement is this onCreate custom Adapter class onActivityResult addItem..