I have a application with a WebView, most of the time it stays portrait mode, but but certain time, I want to force to landscape mode, for example, for image display. How should I do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Go step-by-step:
WebViewis an image or not. The easiest way to do so is just checking the URL extension by setting aWebViewClientand overriding theonPageStartedmethod. Of course, this is not completely reliable since the URL for images sometimes does not have an extension.setRequestedOrientationmethod of theActivityclass: