我要建一个应用程序,它会从库中打开图像。图像被成功打开,但我想知道我是否可以强制在纵向模式下打开的形象呢?
这是我使用的意图:
意向意图=新的意图(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(文件),图像/ *);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(意向);
解决方案
使用安卓screenOrientation =画像
在清单中的每个<活动/>
标记......它会工作......我friend..try它
I'm building an app which will open an image from gallery. The image is opened successfully but I would like to know if I can force the image to be opened in portrait mode?
This is the Intent I'm using :
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"image/*");
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);
解决方案
use android:screenOrientation="portrait"
in manifest in each <activity/>
tag...it will work...my friend..try it