I\'m a new programmer and new in Android. I\'m using this example http://www.androidhive.info/2012/09/android-adding-search-functionality-to-listview/ and it works great. >
You should definitely extend you ArrayListAdapter
and implement this in your getView()
method. The second parameter (a View
) should be inflated if it's value is null
, take advantage of it and set it an onClickListener()
just after inflating.
Suposing it's called your second getView()
's parameter is called convertView
:
convertView.setOnClickListener(new View.OnClickListener() {
public void onClick(final View v) {
if (isSamsung) {
final Intent intent = new Intent(this, SamsungInfo.class);
startActivity(intent);
}
else if (...) {
...
}
}
}
If you want some info on how to extend ArrayListAdapter
, I recommend this link.