Show image in Fulscreenmode with Intent
Hi I need to find a way to start an Intent from clicking a listview item and show me an image with unique ID in fullscreen mode so I can scroll left or right开发者_如何学Go and switch with different images.Any idea how I have to do this?
add an onItemClickListener to your ListView, take it's position and add it to your intent.
Intent i = new Intent(this, newactivity.class);
i.putExtras("key", id);
i.startActivity();
in the new activity, you can open an xml with 1 imageview that takes up the entire screen.
tho, you ask to scroll left and right, I don't get that part...
so if you have 5 items in listview, and I tap on item 3, I'd get a fullscreen view on image 3, but I'd be able to swipe left and right for previous and next image?
in the new activity you can retrieve your clicked id by doing:
Bundle extras = getIntent().getExtras();
int id = (int) extras.get("key");
精彩评论