screen-orientation

onConfigurationChanged is not getting called any time in android

左心房为你撑大大i 提交于 2019-12-01 07:26:04
问题 I have create sample program to test Orientation. If portrait mode and I tilt the phone the other way round I want my sample app to reversePortrait. After reading lot of questions on this - Figured we need to need use: onConfigurationChanged(Configuration newConfig) I was trying out the following: @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); Configuration c = getResources().getConfiguration(); Log.e("Config",""+c); if (c

iPhone cannot rotate movie to landscape mode using MPMoviePlayerViewController

江枫思渺然 提交于 2019-12-01 04:03:20
[update] As was recommended I changed all the parent view controllers to support all orientations. My app structure is as follows: AppDelegate > RootViewController > Videos > VideoDetails > MPMoviePlayerViewController. The video will play in landscape if I change all these to support all orientations. But supporting all orientations is not what I want and causes other issues. Is there any other work around or anything else I can do? Thanks [/update] I have an portrait based iPhone app that displays videos using a custom subclass of MPMoviePlayerViewController. When the user presses play I

iPhone cannot rotate movie to landscape mode using MPMoviePlayerViewController

五迷三道 提交于 2019-12-01 00:59:44
问题 [update] As was recommended I changed all the parent view controllers to support all orientations. My app structure is as follows: AppDelegate > RootViewController > Videos > VideoDetails > MPMoviePlayerViewController. The video will play in landscape if I change all these to support all orientations. But supporting all orientations is not what I want and causes other issues. Is there any other work around or anything else I can do? Thanks [/update] I have an portrait based iPhone app that

JQuery Mobile Beta 1 is not resizing the screen on iphone when rotated to landscape

浪子不回头ぞ 提交于 2019-11-30 21:03:55
I am writing mobile app with JQUery Mobile Beta 1 and was expecting that the screen should adjust automatically on iphone when rotated from portrait to landscape and vice versa but it is not happening. I simply checked with opening this link (Beta 1 doc demo) http://jquerymobile.com/demos/1.0b1/docs/pages/page-template.html but it is also not adjusting the screen. Am I missing something? EDIT: It seems to be same for Beta 2. I checked the demos & docs iPhone and it behaves similarly. I need to tap a screen to adjust it. Not doing automatically as in portrait orientation. Itizme In your

Can I determine if a device is in portrait or landscape mode using jquery?

匆匆过客 提交于 2019-11-30 20:56:14
I want to conditionally alter what the user sees on the photo gallery web site I'm going to create based on if the device being used to view the site is in portrait/vertical vs. landscape/horizontal mode/orientation. Is this possible? Try the orientationchange event handler, something like this: $(window).bind("orientationchange", function(evt){ alert(evt.orientation); }); Here's the jQuery Mobile entry on detecting and firing the orientationchange event. If you are just changing the layout, consider CSS Media Queries instead. In Chrome 7 and Firefox 3.6, there is the deviceorientation event

Android: Efficient Screen Rotation Handling

泄露秘密 提交于 2019-11-30 19:48:45
In Android, when the screen orientation changes (between landscape and portrait) the onCreate method is called which ,if not handled properly, will recreate the entire activity when the result is too simply change the layout and retain all of the same information. I know of a few ways to solve this, but I'm interested in the most efficient way. 1) Telling the manifest that I will handle the orientation change by overriding the onConfigurationChanged() method and leaving it empty. 2) override onSaveInstanceState() and save the data here to be repopulated in onCreate() 3) Override onPause()

Tablet Screen Orientation Change - No View found for id for Fragment

风格不统一 提交于 2019-11-30 19:35:49
I have looked at questions related to my problem on SO but couldn't figure out what the problem is. Bear with me if this is a repost. Here is what i am looking for: The layout changes for phone are working fine as it involves the same views inside the fragment. The problem is when i try get the below layout in tablets. activity_main.xml in portrait mode: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout_width=

Android Action Bar Tab with scrollview made duplicate view after orientation change

╄→гoц情女王★ 提交于 2019-11-30 18:14:01
I have a very simple code where I use Action Bar with tab fragments. It works fine after load, but after orientation change it goes crazy. The old fragment also visible (why?). Sorry for Hungarian texts on the image, but I hope it doesn't matter. I attach the code, maybe it helps to solve this problem. Main activity: public class Main extends Activity { private static ActionBar actionBar; @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setup action bar for tabs actionBar = getActionBar(); actionBar.removeAllTabs(); if (actionBar

Can I determine if a device is in portrait or landscape mode using jquery?

徘徊边缘 提交于 2019-11-30 17:39:09
问题 I want to conditionally alter what the user sees on the photo gallery web site I'm going to create based on if the device being used to view the site is in portrait/vertical vs. landscape/horizontal mode/orientation. Is this possible? 回答1: Try the orientationchange event handler, something like this: $(window).bind("orientationchange", function(evt){ alert(evt.orientation); }); Here's the jQuery Mobile entry on detecting and firing the orientationchange event. 回答2: If you are just changing

How do I lock screen orientation for phone, but not for tablet? (Android)

核能气质少年 提交于 2019-11-30 17:24:58
I have been working on a Android project, that is intended to be compatible with both the Android phones and tablets. On the tablet the app is working great and looks good too. However, on the phone we have been running into issues both programmatically and layout wise (working with a 10.1 inch screen is a lot easier than a 4 inch screen). To solve some of these problems we have decided to deactivate screen orientation but only for the phone version, atleast temporarily. The question is simple, how do I deactivate the screen orientation for Android phone, while keeping it active for the