screen-orientation

Viewflipper Receiver not registered error while orientation change in 2.1 and 2.2

夙愿已清 提交于 2019-12-05 18:00:41
I am using viewflipper for fling gesture recognition everything works fine for 2.0 and prior but in 2.2 and 2.1 it throws exception as "java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper" below is full debug trace. java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper$1@452f8398 09-19 11:33:06.825: ERROR/AndroidRuntime(393): at android.app.ActivityThread$PackageInfo.forgetReceiverDispatcher(ActivityThread.java:793) 09-19 11:33:06.825: ERROR/AndroidRuntime(393): at android.app.ContextImpl.unregisterReceiver(ContextImpl.java

Android - Dealing with a Dialog on Screen Orientation change

依然范特西╮ 提交于 2019-12-05 17:39:20
问题 I am overriding the onCreateDialog and onPrepareDialog methods or the Dialog class. I have followed the example from Reto Meier's Professional Android Application Development book, Chapter 5 to pull some XML data and then use a dialog to display the info. I have basically followed it exactly but changed the variables to suit my own XML schema as follows: @Override public Dialog onCreateDialog(int id) { switch(id) { case (SETTINGS_DIALOG) : LayoutInflater li = LayoutInflater.from(this); View

AdView bug causing all webviews stop loading when orientation changes and multi-threads are running?

妖精的绣舞 提交于 2019-12-05 13:56:15
I just found a problem with Adview when screen orientation changes and multi-threads are running. I think this might be a bug of Adview. And this problem impacts all the webviews in the application. The webviews stop loading any content, i.e. they either show blank or the content that was shown before. The test environment is Platform: Google Nexus S + Android 4.1.2 (not only this platform, a lot of other platforms, even the emulators are affected) Ads SDK: 6.4.1 (we also tested Ads SDK 4.1.1 which has the same problem) The way to reproduce this issue is construct an android project using the

Phonegap page has wrong rotation, shows as portrait in landscape mode

你。 提交于 2019-12-05 12:10:16
I have a (simple) web page packed in a phonegap app. If I start the app it shows the page in portrait direction with landscape page width. So the text starts left bottom to left top. On the right I have a gap where the page should end. This is what I see: Supported orientations are landscape left and right in my ...-Info.plist : <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationLandscapeRight

How to change screen orientation, without creating a new activity on android?

痞子三分冷 提交于 2019-12-05 12:07:55
I do not know if the title is correct, here is what happens. I have an application which works differently on a phone and on a tablet, on a phone it shows as portrait on a tablet it shows as landscape. To achieve this I created a class called CoreActivity which is extended by all my activities and does the following: public class CoreActivity extends Activity { protected boolean _landscape = false; public boolean isPhone() { int layoutSize = getScreenLayoutSize(); return (layoutSize == Configuration.SCREENLAYOUT_SIZE_SMALL || layoutSize == Configuration.SCREENLAYOUT_SIZE_NORMAL); } @Override

android:screenOrientation=“sensorPortrait” doesn't work on API +17

混江龙づ霸主 提交于 2019-12-05 11:27:00
I want my application to work in Portrait & reversePortrait mode .. In other words, I want it to work in portrait and make it rotatable 180 degrees! I'm using the following code within <activity> tag of the MainActivity in the Manifest. android:screenOrientation="sensorPortrait" However, this seems to work only on Android 4.1.2 and backward. It doesn't work on Android 4.2.2 and above! I tried on different phones, the same result! How to solve it? I'm aware of a typo error by Google that replaced sensorPortrait by sensorPortait at some point. Not sure if that is your case, but depending on your

onSurfaceChanged called twice

柔情痞子 提交于 2019-12-05 10:08:46
I'm creating an Android application using openGL ES, and I have following problem: When I minimize the application, then reopen it, onSurfaceChanged in my GLSurfaceView.Renderer is called 2 times. I have the following code in onSurfaceChanged (and similar code in onSurfaceCreated,onDrawFrame): Log.e("onSurfaceChanged",Integer.toString(width)+" "+Integer.toString(height)); So I get the following log: onSurfaceCreated onSurfaceChanged 480 800 onDrawFrame onSurfaceChanged 480 800 onDrawFrame onDrawFrame onDrawFrame onDrawFrame onDrawFrame onDrawFrame (...) When I minimize, change screen

How to deal with background image orientation in UIView

我是研究僧i 提交于 2019-12-05 07:20:46
问题 I'm using setting the background image using methodology below. When I rotate my device the background repeats, which make sense because it is not an image. How do I deal with orientation change if this is the way I'm setting my background image? - (void)viewDidLoad { [super viewDidLoad]; UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"background.png"]]; self.view.backgroundColor = background; [background release]; } 回答1: It took me awhile to understand this

How I can get screen orientation?

a 夏天 提交于 2019-12-05 04:03:50
问题 I'm entering number of screen on which I want to show the form. And I must get screen orientation. Does anybody know how to do that? public UIManager(int screenIndex) { this.ScreenIndex = screenIndex; try { Screen[] all_screens; all_screens = Screen.AllScreens; if (all_screens.Length >= ScreenIndex) { this.customer_form.Left = all_screens[this.ScreenIndex].Bounds.Width; this.customer_form.Top = all_screens[this.ScreenIndex].Bounds.Height; this.customer_form.Show(); } } catch { //Do nothing }

How to catch DOMException in Chrome?

[亡魂溺海] 提交于 2019-12-05 02:09:48
I get this error: Uncaught (in promise) DOMException: lockOrientation() is not available on this device. code: 9 message: "lockOrientation() is not available on this device." name: "NotSupportedError" when I run the following code in Chrome: try { screen.orientation.lock('portrait'); } catch (error) { // whatever } The fact that the error is being thrown is expected, since Desktop Chrome doesn't support orientation locking. I'd like to catch the error so it doesn't litter the console, but wrapping it in a try...catch block doesn't seem to work. Why can't I catch it? Am I missing something? try