Android :: Change Landscape To Portrait It Always Start Activity From Beginning?
Mar 10, 2010
I have written code to display images in sequence. when click on next button it shows next image.and so on. i m using android 1.5 and save landscape images with same name(as portrait images have) in drawable-land folder. when i rotate the device it takes all landscape image from drawable- land folder. but the problem is ,it again start showing images from the beginning. how to solve this problem.
View 2 Replies
Mar 6, 2010
If I go through the following sequence then tap "Search Text" the keyboard will not display - is something broken?
1. Start in Portrait
2. Tap Browser
3. Tap Google Search
4. Input text
5. Tap desired Website
6. Rotate Hero to Landscape
7. Tap Menu
8. Tap More
9. Tap Find on Page
10. Tap "search text" - nothing happens!
The above works if I stay in Portrait and if I do not rotate to landscape until after step 9.
View 4 Replies
View Related
Nov 1, 2010
I want to change the screen orientation from portrait to Landscape and vice-versa when the user shakes his/her android mobile phone, can any one help how to achieve this, because I do not know what event is fired, at the time his/her shaking thier android mobile phone. For Instance When the users touch the button in UI, touch event is fired, similarly when the user shakes his android mobile phone, what is fired.
View 3 Replies
View Related
Jan 2, 2010
How do we change emulator screen orientation to landscape or portrait?
View 2 Replies
View Related
Jun 19, 2010
Is anyone else experiencing slow rotation of keyboard from portrait to landscape? Sometimes it takes 5-10 seconds.
View 2 Replies
View Related
Oct 11, 2010
I want to to start the application from beginning, once i click on home button. Now, If i click on home button, and i want to again open the application it preserve the initial state, and automatically ll go there, But I want it will start from beginning.
View 3 Replies
View Related
Apr 21, 2010
I'm a beginner in programming. My experience so far is only in Actionscript 2 and 3. So I have a basic understanding of declaring variables, loops, arrays, if/then, do/while... I'm wanting to move to developing for Android phones so I'm wondering what suggestions people have for where to go next. Should I jump right to Android? Start with a 'beginning Java' approach? Or should I go some other route to beef up my knowledge of OOP concepts before launching into Android? I have my Dev environment set up and completed the Hello Android tutorial and I'm just wondering if I am going to be in over my head quickly?
View 6 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
Mar 12, 2010
I'm trying to find a way to properly handle setting up an activity where its orientation is determined from data in the intent that launched it. This is for a game where the user can choose levels, some of which are int portrait orientation and some are landscape orientation. The problem I'm facing is that setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) doesn't take effect until the activity is fully loaded. This is a problem for me because I do some loading and image processing during startup, which I'd like to only have to do once.
Currently, if the user chose a landscape level:
the activity starts onCreate(), defaulting to portrait discovers from analysing its launching Intent that it should be in landscape orientation continues regardless all the way to onResume(), loading information and performing other setup tasks at this point setRequestedOrientation kicks in so the application runs through onPause() to onDestroy() it then again starts up from onCreate() and runs to onResume() repeating the setup from earlier
Is there a way to avoid that and have it not perform the loading twice? For example, ideally, the activity would know before even onCreate was called whether it should be landscape or portrait depending on some property of the launching intent, but unless I've missed something that isn't possible. I've managed to hack together a way to avoid repeating the loading by checking a boolean before the time-consuming loading steps, but that doesn't seem like the right way of doing it. I imagine I could override onSaveInstanceState, but that would require a lot of additional coding. Is there a simple way to do this?
Solution:
As per Daniel's answer, this was actually quite easy to fix. I just needed to make a few small changes. In my 'menu' Activity, where the player would choose which level to play, I just had to add an if/else check to choose which class would be started by my Intent. This was done with a simple int representing portrait or landscape, determined when the player selected a level. I then created a second class extending my 'GameLogic' class; this is the class which contained most of the code for the game itself, rather than the menus, instructions, etc.
public class GameLandscape extends GameLogic{}
Literally that simple and completely empty. That way it inherited all the code from my previous activity where I had already coded it to handle things differently depending on the orientation. Lastly I just had to add a line to the manifest stating that GameLandscape would always run in landscape, and GameLogic would always run in portrait.
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 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
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
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
Jun 17, 2010
How to add rotation effect when change mode portrait to landscape? I want to make it smooth.
View 2 Replies
View Related
Sep 26, 2010
I made an app thats use the camera. The first problem i get was that i can't use portrait preview without the rotation 90º image. I used the solution (landscape for all), but now, only in the real device, when i start the app and i have the device in portrait mode it crashes (need to force close) and only after reboot the phone its possible to connect to camera, even in the camera app.
View 2 Replies
View Related
Aug 13, 2010
It seems when screen orientation changes, the activity's onCreate() method is called. In my onCreate() method, I have an AlertDialog which pops up when the activity is called. The problem is when I switch the screen sideways, the popup is displayed again. How can I avoid this?
View 1 Replies
View Related
Aug 3, 2010
Since the FROYO update some stuff is only in Lanscape and it's what I would call upside down. Is there a fix for that? Like Gmail and internet and some others I noticed. Other than that it's smokin fast and everything is working fine for me.
View 16 Replies
View Related
Jun 19, 2010
As u know, since android 1.6, there are not dirs on dirs like HVGA-L. Instead, there is only one dir like HVGA. That is, HVGA-P and HVGA-L are merged into one dir, HVGA. So, only HVGA can be selected and by default the emulator is started with portrait mode. Though I can press CTRL+F11/F12 to switch it to landscape mode, I do not like it. What I want is to start the emulator with default mode of landscape. Would anyone know how to do it?
View 3 Replies
View Related
Nov 10, 2010
While working on orientation change I have found that the onConfigurationChanged is not getting called when changing the orientation from portrait to landscape.But when I am changing from landscape to portrait the method is getting called. Is it the correct behavior because the onConfigurationChanged should by called whenever we are changing the orientation. (android:configChanges="orientation")? I have also found one strange behavior or error, When we are changing from portrait to landscape orientation the string value is displayed correctly(automatically by android system) but when in am changing the orientation from landscape to portrait the same string is displayed(i.e the string in landscape mode).The expected behavior is the string id specified in the portrait mode should be displayed.Is it an platform bug or something wrong in my code/programming.
View 2 Replies
View Related
Aug 25, 2009
Does anybody know how to rotate whole system screen from landscape to portrait?The platform is not G1 or any other phones, it's just a normal ARM platform.Not only one application but whole system.
View 1 Replies
View Related
Aug 20, 2010
I like to use Swype in portrait mode but the Android keyboard in landscape mode. Is there an app to auto-switch the keyboard based on the orientation of the phone?
View 13 Replies
View Related
Nov 15, 2009
I have an app that I started in 1.6. It used images that were specific to portrait and landscape layouts. I put these in the corresponding drawable folders, for example:
drawable/image01,png
drawable-land/image01.png
when I created a new project with 2.0 it gave me the following folders. drawable drawable-hdpi drawable-mdpi drawable-lpdi. when I look at the documentation around these folders it all seems very straight forward. I assumed that you were able to create the following folders. drawable-hdpi-land drawable-mdpi-land drawable-lpdi-land
and everything would work as before. The image directory would swap automagically pulling the appropriately laid out image depending on your screen orientation. Unfortunately it does not. The SDK seems to get confused, and if I clean the project, the folders come up as poorly named.
View 3 Replies
View Related
Feb 1, 2009
Is there a way to pro grammatically force the screen to change between landscape and portrait mode? I want to allow the user to choose a menu item to rotate the screen, instead of relying on pulling out the keyboard. I am looking for something like activity.change Screen Orientation, but couldn't find such a thing in the API docs.
View 3 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
Aug 29, 2010
I am finding that my layouts tend to look great in one orientation but if I change the phone's orientation, things are a mess. For example on one screen I have 6 large buttons that look great in portrait orientation but if the user changes phone orientation, those buttons get cut off in portrait.
Do I need to code two layouts for every screen - one for portrait and one for landscape? That would be such a waste of time.
View 1 Replies
View Related
Nov 5, 2009
I want to know the device state programmatically.
I mean whether the device is in portrait mode or in landscape mode by programming (in a class which extends the Activity).
View 4 Replies
View Related
Mar 28, 2010
How to rotate the screen to landscape (or portrait) by programmable way? I am trying to make it independent when user rotates the screen.
View 2 Replies
View Related
Apr 19, 2010
My application should hold a camera preview surface. The camera is fixed to landscape view via AndroidMainfest.xml I am quite new to the Android plattform programming. Of course I don't know much about the programming tricks and workarounds yet. I did a lot of research over the last two weeks (even studied the native Camera implementation), but couldn't find a good solution so far.
View 2 Replies
View Related