orientation

Call finish() inside onPause() but not when orientation changes

放肆的年华 提交于 2019-12-22 08:32:15
问题 I have an app that needs to call finish when someone exits its main activity (so i do not want it to be paused ), even by pressing home activity has to be finished, to handle this currently i simply call finish() in my onPause() method, since everything is done with fragments it works pretty well and gives no stability issues. My only problem is that i cannot handle orientation changes since onPause() is called before onConfigurationChanged() (allowing me to disable this behavior when

Loss of variables switching orientations

人盡茶涼 提交于 2019-12-22 04:11:08
问题 Im new to android. I have written a couple of programs and tried them out on my phone. When I switch orientations its like my phone restarts the program. All my variables get reset. In fact the only thing that does not reset is the text that is in the edit text views. What causes this? How can I stop it? I have tried looking it on google and on stack overflow but all I am seeing is how to the view orientation from changing all together. I even tried, in one program, to set my variables with

Android portrait video orientation wrong in VideoView

孤街醉人 提交于 2019-12-22 03:48:07
问题 I capture a new video in PORTRAIT orientation on an Android device like this: Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(intent, 1886); and it gives me this file: "/mnt/sdcard/DCIM/Camera/video-2012-02-02-10-45-48.mp4" Then I play it like this: private VideoView videoView = (VideoView) findViewById(R.id.videoView); String videoUrl = "/mnt/sdcard/DCIM/Camera/video-2012-02-02-10-45-48.mp4"; videoView.setMediaController(new

Android portrait video orientation wrong in VideoView

萝らか妹 提交于 2019-12-22 03:46:28
问题 I capture a new video in PORTRAIT orientation on an Android device like this: Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(intent, 1886); and it gives me this file: "/mnt/sdcard/DCIM/Camera/video-2012-02-02-10-45-48.mp4" Then I play it like this: private VideoView videoView = (VideoView) findViewById(R.id.videoView); String videoUrl = "/mnt/sdcard/DCIM/Camera/video-2012-02-02-10-45-48.mp4"; videoView.setMediaController(new

Mobile Website: Orientation change from portrait to horizontal

百般思念 提交于 2019-12-21 23:50:36
问题 I'm developing a mobile website for iPhone and Android browsers. As I was playing around with an Iphone 4 and a HTC Desire I found out that the two devices react differently on orientation change. If I load the website in portrait mode and then rotate the device to horizontal mode, the Iphone zooms closer to the content using the same width (320px). With an Android device, if I rotate it seems that the viewport changes, so there isn't any zooming going on (width >320px), instead the websites

Android: Programmatic 'allow reorientation' preference works only once

拟墨画扇 提交于 2019-12-21 21:28:25
问题 I have a CheckBoxPreference with key "allow_reorientation". If enabled then my main activity should reorient upon device rotation, and if disabled it should remain in its current orientation. I have set 'android:configChanges="orientation"' in my manifest.xml to allow custom handling of orientation changes. From my main activity class: @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); SharedPreferences preferences =

Android: set activity orientation BEFORE onCreate, but not in manifest (HDMI plugged in issue)

北城余情 提交于 2019-12-21 21:27:34
问题 I can perfectly manage orientation change programatically, by using setRequestedOrientation in onCreate . Everything works really fine, until I plug a HDMI cable. After this, the tablet "wants" to be in landscape mode. So when I open an activity, it shows first in "landscape" and then right after it shows in "portrait", (because I'm calling setRequestedOrientation(variable_with_orientation_desired_by_the_user) where variable=ActivityInfo.SCREEN_ORIENTATION_PORTRAIT in onCreate As you can "see

Rotate presented view and lock the orientation of presenting view controller

随声附和 提交于 2019-12-21 18:49:30
问题 I am working on iPad application which supports only landscape orientation, i want to allow some presented view controller to support all orientation without changing orientation of presenting view controller. Am supporting all orientation in Xcode Settings except upside down. Code i am using to present view controller ViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"VC"]; vc.modalPresentationStyle = UIModalPresentationFormSheet; [self presentViewController:vc

Change QR Scanner orientation with ZXING in Android Studio

送分小仙女□ 提交于 2019-12-21 17:33:23
问题 I hope you can help me with this. Im using the Zxing Embedded Library in order to use the QR scanner, the problem is that is on Landscape mode and I would like to change it to Portrait. I have this on the dependencies of my Graddle compile 'com.journeyapps:zxing-android-embedded:2.0.1@aar' compile 'com.journeyapps:zxing-android-integration:2.0.1@aar' compile 'com.google.zxing:core:3.0.1' and I have this in my java class to activate the scanner with a button... public void scanQR(View view){

Autorotation not working in iOS 7 , works fine in iOS 6

余生长醉 提交于 2019-12-21 12:01:07
问题 I have an app that supports landscape orientation only on some sections (Photo gallery, video, etc) and all is working fine on iOS 6 with no issues, however, in iOS 7 the app crashes. So heres my issue : start app and load initial nav controller with view controller that only supports portrait push view controller on to stack that supports landscape AND portrait rotate view to landscape pop view controller app crashes --> CRASH: **preferredInterfaceOrientationForPresentation must return a