¡@

Home 

2014/10/16 ¤W¤È 08:16:38

android Programming Glossary: item_key

listView dynamic add item

http://stackoverflow.com/questions/1998483/listview-dynamic-add-item

content auto add list View but 3 times. public class DynamicListItems extends ListActivity private static final String ITEM_KEY key ArrayList HashMap String String list new ArrayList HashMap String String private SimpleAdapter adapter private EditText.. newValue EditText findViewById R.id.new_value_field setListAdapter new SimpleAdapter this list R.layout.row new String ITEM_KEY new int R.id.list_value ImageButton findViewById R.id.button .setOnClickListener getBtnClickListener private OnClickListener.. new OnClickListener public void onClick View view try HashMap String String item new HashMap String String item.put ITEM_KEY newValue.getText .toString list.add item adapter.notifyDataSetChanged catch NullPointerException e Log.i Dynamic Items..

How can I get Android Wifi Scan Results into a list?

http://stackoverflow.com/questions/5452940/how-can-i-get-android-wifi-scan-results-into-a-list

WifiManager wifi ListView lv TextView textStatus Button buttonScan int size 0 List ScanResult results String ITEM_KEY key ArrayList HashMap String String arraylist new ArrayList HashMap String String SimpleAdapter adapter Called when the.. .show wifi.setWifiEnabled true this.adapter new SimpleAdapter WiFiDemo.this arraylist R.layout.row new String ITEM_KEY new int R.id.list_value lv.setAdapter this.adapter registerReceiver new BroadcastReceiver @Override public void onReceive.. .show try size size 1 while size 0 HashMap String String item new HashMap String String item.put ITEM_KEY results.get size .SSID results.get size .capabilities arraylist.add item size adapter.notifyDataSetChanged catch Exception..