Open Image in full screen android

旧城冷巷雨未停 提交于 2019-12-04 13:05:44

You could launch the gallery app itself to view the image using below code snippet You could give this a try.

Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse(file.getAbsolutePath()),"image/*");

startActivity(intent);

I would suggest in onClick method of your thumbnail, you can start a new Activity in fullscreen mode:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

and pass the image uri or something which indicate the image source to the new activity :

Intent intent = new Intent(YouActivity.this, FullImage.class);
intent.putExtra("imageUri", R.drawable.yourImage); // or the path to your image : "/sdcard/MyImages/image.png"

and than just show it in imageView of FullImage Activity like this :

ImageView icon = (ImageView) findViewById(R.id.myImage);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inTempStorage = new byte[3*1024];

Bitmap ops = BitmapFactory.decodeFile(path, options);
icon.setImageBitmap(ops);  // where icon is the imageView in your xml file
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!