Skip to content

Instantly share code, notes, and snippets.

@j-onathan
Created August 6, 2014 16:57
Show Gist options
  • Save j-onathan/625f5143b31ae9fae5bb to your computer and use it in GitHub Desktop.
Save j-onathan/625f5143b31ae9fae5bb to your computer and use it in GitHub Desktop.
protected void onListItemClick (ListView listView, View view, int position, long id) {
super.onListItemClick(listView, view, position, id);
Editor editor = prefs.edit();
editor.putInt("index", listView.getFirstVisiblePosition());
editor.putInt("top", listView.getChildAt(0) == null ? 0 : listView.getChildAt(0).getTop());
editor.commit();
Object o = this.getListAdapter().getItem(position);
String testName = o.toString();
Bundle bundle = new Bundle();
bundle.putString("test", testName);
Intent intent = new Intent(this, GdxTestActivity.class);
intent.putExtras(bundle);
startActivity(intent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment