Code example for SimpleAdapter

Methods: notifyDataSetChanged

0
	public void addItem(String label) {
		HashMap<String, String> info = new HashMap<String, String>();
		info.put(data_labels[0], "Learning Model -- KSVM");
		info.put(data_labels[1], label);
		data.add(info);
		model.notifyDataSetChanged();
	} 
	 
	public void onPushButton(View target) {
		/* Spawn a top-level intent */ 
		Intent intent = new Intent(this, MLService.class);
		intent.setAction(Intent.ACTION_SEND_MULTIPLE);
		intent.addCategory(Intent.CATEGORY_DEFAULT);
		/* Bundle a new work unit */ 
		Bundle bundle = new Bundle(1);
		// bundle.putParcelable(Homework.UUID, new Homework(new KSVM())); 
		intent.putExtra(MLService.SMALL_WORK_UNIT, bundle);
		/* Wrap in a prompt TODO do first? */ 
		Intent request = Intent.createChooser(intent, "Adding KSVM...");
		this.startService(request);
		Toast.makeText(this, "Okay, we'll get right on that.", Toast.LENGTH_SHORT).show();