how to set toast orientation while opened in another intent?

六眼飞鱼酱① 提交于 2021-01-29 01:56:50

问题


Hi I'm using built in android camera:

android.media.action.IMAGE_CAPTURE

and what I'm trying to achieve, is make a TOAST appear after turning the camera on.

The toast works fine, but it always shows in landscape mode. What's funny, I'm starting the toast before calling the intent with IMAGE_CAPTURE, and the toast for few moments shows in proper orientation, but then after turning into camera mode, it automatically flips to the landscape mode.

Because of the idea of my application, I would like it to show only in PORTRAIT mode.

Does anyone have an idea how to force toast orientation ?


回答1:


I very much doubt you will be able to achieve this with the standard toast implementation. The orientation is set for the whole system by the current activity. Everything that is part of the view hierarchy will inherit the current orientation.



来源:https://stackoverflow.com/questions/6123684/how-to-set-toast-orientation-while-opened-in-another-intent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!