Created
June 26, 2015 20:38
-
-
Save emedinaa/f5b46c9a7ee4cd7e24a8 to your computer and use it in GitHub Desktop.
Pasar información desde un listview a otra actividad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void populateData() | |
{ | |
MyAdapter adapter= new MyAdapter(getActivity(),reqMyEntityList); | |
lviRequest.setAdapter(adapter); | |
lviRequest.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |
@Override | |
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { | |
MyEntity myEntity= (MyEntity)adapterView.getAdapter().getItem(i); | |
gotoActivity(myEntity); | |
} | |
}); | |
} | |
private void gotoActivity(MyEntity myEntity) { | |
Bundle bundle = new Bundle(); | |
bundle.putSerializable("ENTITY",myEntity); | |
Intent intent= new Intent(getActivity(), OtherActivity.class); | |
intent.putExtras(bundle); | |
startActivity(intent); | |
getActivity().finish(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment