Code example for ListView

Methods: setSelection

0
	} 
 
	@Override 
	public void onClick(View v) {
		SelectedItem = objects[v.getId()].toString();
		list.setSelection(v.getId());
		TextView tv = (TextView) v.findViewById(getResID("OG_Battery_Name",
				"id")); 
		RadioButton tb = (RadioButton) v.findViewById(getResID(
				"OG_Battery_CBox", "id")); 
		tv.setTextColor(0xffff0000);
		tb.setChecked(true);
		this.notifyDataSetChanged();
		Intent in = new Intent("com.ghareeb.OGMod.DATA_CHANGED");
		in.putExtra("data", SelectedItem);
		getContext().sendBroadcast(in);
	} 
 
} 
Experience pair programming with AI  Get Codota for Java