Android :: NullPointer Exception - Switching From Portrait To Landscape Mode
Feb 11, 2009
I have written a small example which displays the photos from the server. Its working fine when the device is in one of the mode (landscape of potrait). But if I switch to landscape to potrait or potrait to landscape while downloading the photos from the server, I am getting NullPointerException, showing with androidRunTimeException.
I am using LinearLayout -> ImageView
I am using threads to download the images.
View 4 Replies
Feb 25, 2009
I am using Intents to switch between activities in my Android app. I am putting data in the Intent for use in the next activity. When I switch the phone between landscape and portrait modes, the values passed from the intent are lost and I get a NullPointerException.
Can someone please tell me what could be wrong.
There's a lot of code to post it entirely. But if someone needs to look at specific parts of code, I can post it here.
Edit
I solved the issue of state not being saved. But another problem I faced is that none of the buttons on the screen work after the orientation has been changed. On button press, I get this warning in LogCat
02-25 23:07:49.190: WARN/WindowManager(58): No window to dispatch pointer action 0
View 2 Replies
View Related
Apr 3, 2009
I want to display a table which would fit better in portrait view than in the landscape view. How do i instruct the emulator to change the orientation?
View 4 Replies
View Related
Jul 23, 2010
I've met a very strange issue that my app will crash if user first switch to landscape, then back to portrait. I found that Activity.setContentView() will throw an inflate exception. It said:
android.view.InflateException: Binary XML file line #29: Error inflating class <unknown>
This crash will happens on Android 1.6/2.1/2.1-update1, but doesn't happen in 2.2 Froyo. In Froyo, everything works fine. If the XML I used is invalid, it should happens every time when I try to inflate. But why it's okay on the first time of running and switching to landscape? This also only happens on some devices. For example, there two HTC G1 with same software installed on it and has the same configuration, one has this issue and the other one works fine.
View 7 Replies
View Related
Mar 26, 2012
there are those of us, who due to whatever reason (helmet cams, preference for posture, etc) want to record videos in portrait mode.
What happens (on my sgs2) is that the video records just fine in whatever resolution I pick... but it records it 90 degrees rotated to the right.
The solution that is usually offered is that "you can rotate it after!" yes... but then you have to CROP part of the image and lower the resolution. 1920 x 1080 recordings end up having to be cropped so that half of the view is cut out , or even more if you are maintaining a real aspect ratio.
The questions about "why not just hold it sideways", are just as pointless as the statement by steve jobs telling iphone4 users that they were holding their phones wrong.
is this something that can be remedied ? or has google decided that people should only record videos when their phones are in landscape mode?
i understand that we cant see landscape resolution in portrait mode; but can't we just have a viewport into the camera, but record in properly oriented landscape mode? so that playback on a computer will show the full resolution, even though we will only see part of it on the phone..
View 1 Replies
View Related
Dec 1, 2013
dialer in kitkat is always in landscape mode when call is ongoing....how can we set it in portrait mode
View 1 Replies
View Related
Mar 31, 2009
When we try to implement orientation in AP layer, we can set "android:screenOrientation" parameter in AndroidManifest.xml file or call "setRequestOrientation()" method of Activity class. But if I want to porting android in new HW device, how can I do? Do I need to modify the graphic driver, or just add configuration in program. (Actually I do some experiments but my AP cannot rotate) Besides, can every experts tell me when I set the "android:screenOrientation" parameter, which process will read this configuration, pass to where and which process will do the rotation?
View 2 Replies
View Related
Oct 1, 2009
I am facing a problem when i put a text view on screen in landscape mode it position is fine but when i switch to portrait mode it position is remain fix it not change according to screen resolution.
View 2 Replies
View Related
Jan 22, 2010
Do you use landscape or portrait mode? And which keyboard do you use to post, virtual or real, since the virtual one hides the screen for some reason? I posted this from my Droid, just to prove to myself that I could real keyboard, big hands no problemo. Few typos, but easily fixed. No worse than I do on a life-size keyboard at home.Droid looks to be about the size of a busines card next to my big thumb. I can still somehow peck the keys fairly quick.
View 10 Replies
View Related
Sep 8, 2010
I am using VideoView component for streaming video in Android , but I am not getting the full screen display.
Kindly provide the code to display full screen in portrait/landscape mode.
View 2 Replies
View Related
Jun 17, 2009
My application crashes when I switch the Android Emulator to landscape mode. But when I start the application, everything works fine, until I switch to portrait mode again.
The error only occurs when I switch from one mode to another. When I debug my app while switching to the other mode everything works fine until my program counter jumps out of the onCreate() function.
this is an error message i picked out: java.lang.RuntimeException: Unable to start activity ComponentInfo {com.prog.drink/com.prog.drink.App}: java.lang.IllegalArgumentException: Wrong state class -- expecting View State
Any idea what I could have done wrong in my app?
View 5 Replies
View Related
Apr 11, 2010
This is probably a pretty easy to answer question, but I can't find the solution myself after a couple hours of searching the documentation and Google.I set the orientation of my Android app to landscape in the AndroidManifest.xml file: android:screenOrientation="landscape"
However, when I run the app in the simulator, it appears sideways and in portrait mode. How can I switch the emulator to landscape mode on a mac? It's running the 1.6 SDK.
View 3 Replies
View Related
Jul 6, 2010
I'm responding to an email and I rotate the phone to landscape mode. Once completed, I turn the phone upright and it remained in landscape mode. The only way to get it back was to hit the menu button. I rotated to landscape a few minutes later and now its stuck in that mode, and won't return to portrait at all. I tried removing the battery to no avail.
View 3 Replies
View Related
Dec 9, 2009
I discovered something unusual today. I've been using a lot of the physical keyboard, especially for long winded texts and e-mails. I have tried and tried to get used to the landscape on-screen keyboard to no avail. I've tried Better Keyboard (and yes, it's better), and the HTC keyboard (that unfortunately doesn't fill the screen). They both have their benefits, but I cannot accurately and consistently type out a message on any of them. My problems: If I type too fast, half of the letters don't register. I've tried pressing harder, using a lighter touch, neither had any affect. I can't get used to the position I need to have my thumb in to actually register clicking certain letters on the keyboard. I always think I've got it, but then I look up at what I just typed (I find myself staring at the keys I'm pressing to make sure they're the right ones) and it is complete gibberish. Where I'm going with this, anyways, is the portrait keyboard. I used it a few times today just out of laziness, I didn't feel like turning the screen or opening up the device to use the physical. I noticed something unusual; I don't make the same mistakes on this tiny little keyboard, and I can actually type relatively quickly. My sentences weren't coming out meaningless, and I wasn't seeing unregistered presses. So my question to you is this - has anybody else noticed similar problems? I don't really think it's a fault of the phone. I think I'm just not used to on-screen keyboards (never used one before) and thus cannot type well on it. I'm hoping that - at some point - a multi-touch enabled keyboard comes out, because I feel like some of my problems are due to hitting two keys in rapid succession, and having one or both not register. Until then, I will continue to practice with it, but I just can't figure out why I can type on the tiny portrait keyboard and not on the full landscape version.
View 3 Replies
View Related
May 3, 2010
Just wondering what people use the most when using their phones, so I made a poll. I use mine mainly in portrait I just don't like typing with swype using landscape.
View 7 Replies
View Related
Sep 2, 2010
I am having a lot of difficulty with my keyboard in both landscape and portrait. I am using the "Android Keyboard" that came with the phone. Examples of what I am referring to:
1. Wrong Key Showing: I type one letter and a different one is actually displayed.
2. Horrible Response: I get half way through an email and realize I need to fix an error in the middle of the paragraph. Trying to get the cursor where I want it a extremely hard to do and often it will move, but not where it is suppose to be moved to. Other times the cursor simply doesn't move at all and I have to erase all the back to where the error is and than retype. And no the cut and paste or copy and paste do not work since the cursor is not moving.
3. Random sentences just erase: I will be typing and hit the back key to erase a character, but instead it erases a line or two and won't stop.
Suggestions and no I am not going to root and void the warranty.
View 7 Replies
View Related
May 9, 2010
I was wondering if there's a way to change default input options for portrait and landscape modes independently? I like using swipe for portrait and full keyboard for landscape and its kinda annoying to keep changing it every time.
View 3 Replies
View Related
Aug 4, 2010
Is it possible to have it so i have swype when the phone is in portrait mode and have multi touch when it is in landscape? it's hard to swype on landscape so multi touch would be awesome.
View 7 Replies
View Related
Mar 8, 2010
When I go to portrait to landscape it will stay on portrait then after I mean like 20 mins or so when I go to use it, it will go to landscape and portrait. Then after another while it will stay on portrait and not go to landscape. I've tried everything and tried to find a solution for this but don't seem to find one. I just got the phone on saturday and been playing with for awhile to get the feel of it.
View 2 Replies
View Related
Jul 21, 2010
So my Aria is less than 24 hours old and twice now when texting in landscape mode a Force Close pops up and I can only type in portrait mode. I am using HTC keyboard and have not loaded any other keyboard. is this happening to anyone else?
View 20 Replies
View Related
Jun 4, 2010
So when today the phone would switch into landscape mode when i would text, but now it no longer does. what is the deal!
View 6 Replies
View Related
May 25, 2010
Had the phone about 30 hours or so, been happily learning the ins and outs of my first android. Was streaming Pandora for a couple hours while working, then went to type a text and the full size landscape qwerty wouldn't come up only that aweful portrait mode cramped keyboard that makes me feel like I am typing on a blackberry now the browser won't switch to landscape either which is 'incredibly' annoying. Teeter seems to work fine, on level 19 and also "Bubble" an app for Leveling which switches to landscape in either direction.
View 2 Replies
View Related
Nov 20, 2010
Why the following xml file should throw NullPointer exception? If I remove all reference to the array hrs_to_wait_values it is ok.
CODE:..............
View 1 Replies
View Related
Mar 14, 2010
I have an activity which shows some List entries. When I click on a list item my app checks which connection type is available ("WIF" or "MOBILE"), through NetworkInfo.getTypeName(). As soon as I call this method I get a NullpointerException. Why? I tested this on the emulator, cause my phone is currently not available (it's broken...). I assume this is the problem? This is the only explanation that I have, if that's not the case I have no idea why this would be null. Code...
View 4 Replies
View Related
Aug 22, 2009
I have trouble launching the WebBrowser with an Intent with a Button Click. I try doing this in the onCreate Method of my Activity:
CODE:...........
Its in the View like this:
CODE:...............
When i launch the Activity i get a force close with this in the log:
CODE:..........................
View 5 Replies
View Related
Oct 12, 2010
I know if you change a android phone from portrait to landscape sometimes the app relays its self out on the screen.. so how do I simulate rotating a phone with the AVD? On the Blackberry emulators there's a button in the menu to turn the phone, but I can't find it or any option on the Android ones?
View 1 Replies
View Related
Jul 8, 2010
How did you support both landscape and portrait for appwidget? the layout of appwidget will never change when orientate the device from landscape to portrait. by the way, would you please tell me which device support both landscape and portrait for appwidget?
View 1 Replies
View Related
Feb 18, 2010
For changing from portrait to landscape mode i have done some changes in manifest.xml and included some code in test.java file
In manifest.xml i have included <activity_name android:configChanges="orientation"/>
i entered some data in portrait mode. but when i rotate my mobile from portrait to landscape the control goes to onConfigurationChanged() method.
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); setContentView(R.layout.screen1_landscape);
}
View 3 Replies
View Related
Dec 18, 2009
I'm trying to detect landscape vs portrait orientation with the following:
public void onSensorChanged(SensorEvent event) { float pitch = event.values[2];
if (pitch <= 45 && pitch >= -45) { // portrait }
else if (pitch < -45) { // landscape }
else if (pitch > 45) { // landscape } }
Anyone have something more robust? It works pretty well, except if the phone is in a landscape orientation and the user starts to 'flatten' it out, starts thinking it's in the portrait orientation again.
View 7 Replies
View Related
Jan 23, 2010
I've seen references to being able to specify two separate layout xml files for an activity, one for Portrait and one for Landscape. I've not been to find any information on how to do that though. How do I specify for each activity which xml file is it's portrait layout and which is the Landscape layout? Is it also possible to specify different layouts for different screen sizes? If so, how is this done?
View 2 Replies
View Related