Skip to content

Instantly share code, notes, and snippets.

@theSociableme
Created November 23, 2012 22:03
Show Gist options
  • Save theSociableme/4137497 to your computer and use it in GitHub Desktop.
Save theSociableme/4137497 to your computer and use it in GitHub Desktop.
ListView onItemClick
@Override
protected void onPostExecute(ArrayList<Tip> result) {
TipsAdapter adapter = new TipsAdapter(mContext, result);
tips_list.setAdapter(adapter);
tips_list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
Tip clicked_tip = (Tip) tips_list.getItemAtPosition(position);
Intent intent = new Intent(getApplicationContext(), MessageListActivity.class );
intent.putExtra("tipId", clicked_tip.getId());
startActivity(intent);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment