Skip to content

Instantly share code, notes, and snippets.

@Devansh-Maurya
Last active August 22, 2018 14:02
Show Gist options
  • Save Devansh-Maurya/b3da5393871bcfff75b248a02ecf02e8 to your computer and use it in GitHub Desktop.
Save Devansh-Maurya/b3da5393871bcfff75b248a02ecf02e8 to your computer and use it in GitHub Desktop.
ListView petListView = findViewById(R.id.list);
petListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
Intent intent = new Intent(CatalogActivity.this, EditorActivity.class);
Uri currentPetUri = ContentUris.withAppendedId("content://com.example.android.myapplication/pets", id);
intent.setData(currentPetUri);
startActivity(intent);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment