Android :: Way To Make Application To Completely Ignore Screen Orientation Change?

Sep 11, 2009

is there a way to make application to completely ignore screen orientation change?

Android :: way to make application to completely ignore screen orientation change?


Motorola Droid :: Any Way To Make Home Screen Change Orientation?

Nov 11, 2009

Is there a way to make the home screen change orientation with the accelerometer? On my phone, it will only change when I pull out the physical keyboard, which is not really what I'm looking to do most of the time.It changes just fine in all other applications, but the home screen doesn't. Is this a flaw with my phone or a design decision?

View 6 Replies View Related

Android :: Application Restarts On Orientation Change

Nov 2, 2010

When I change orientation application restarts and I lost my current data.. I am using activity group which contain lots of activities when i change orientation application restarts from main activity. is it possible to avoid this application restart on orientation change?

View 4 Replies View Related

Android :: Screen Orientation Change

Oct 8, 2009

I notice when using the emulator that when the screen is flipped, I get a following logcat message:

INFO/WindowManager(589): onOrientationChanged, rotation changed to 1

How can I catch this in the code? I want to know whenever the orientation changes. I assume I have to set a listener, but I can't find an example anywhere.

View 6 Replies View Related

Android :: Keep Screen On And Change Orientation

Feb 11, 2009

I am making an Android app which is currently coming along nicely - I've hit upon a couple of stumbling blocks.

1) How do I stop the screen from going dim/off and the phone locking while the application is running?

2) Can I force the phone to enter landscape mode on running my application?

View 2 Replies View Related

Android :: Threads And Screen Orientation Change

Aug 30, 2009

In the following sequence of events:

1. Start a new thread (as a result of a button click - or similar).

2. User changes the screen orientation (causing the Activity that started the thread to be destroyed).

3. Thread finishes, and wants to do some dialog (or any UI) work. However, doing a showDialog, dismissDialog, ... will crash, as the thread it still referring to the old Activity.

This can be solved by updating the data in the thread to refer to the new Activity upon a screen orientation change.

However, couldn't the Android framework just forward any requests from a destroyed activity, to the newly created Activity, saving us developers of handling it ourselves?

View 24 Replies View Related

Android :: Catch Screen Orientation Change In OnPause()?

Apr 23, 2010

Specifically, I need a way of _not_ performing the onPause functionality I've implemented when it occurs because of a change in screen orientation.

View 9 Replies View Related

Android : Does Screen Orientation Change / Effect Performance?

Jan 21, 2009

From reading Romain Guy's blog post, I understand keep static reference to a Drawable can create huge memory leaks. So what is the recommended solution if I don't want to reload my big Drawable image every time screen orientation changes and effect on performance? Currently my app takes >3 seconds to complete each orientation change.

View 8 Replies View Related

Android :: Change Screen Orientation From Portrait To Landscape?

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

Android :: How To Detect Orientation Change In Home Screen Widget?

Mar 15, 2010

I am writing a home screen widget and want to update (modify) the home screen widget when the device orientation changes from portrait to landscape or the other way. How can I make it? Currently, I tried to register to CONFIGURATION_CHANGED action like the code below ...

View 3 Replies View Related

Android :: ViewFlipper Switching Views On Screen Orientation Change

Jan 24, 2010

I have a 3 nested ViewFlippers which seem to be working ok except that when I change the screen orientation the view flip back to the first one of my views, giving the user the impression it went back a few steps.I am a bit stumped as to what to do and was hoping someone had some experience with this.

View 3 Replies View Related

Android :: Handling Screen Orientation Change During Activity Start

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

Android :: Distinguish When App Is Being Finalized Vs Destroyed For Screen Orientation Change

Mar 20, 2010

I am relatively new to the Android world and am having some difficultly understanding how the whole screen orientation cycle works. I understand that when the orientation changes from portrait to landscape or vice versa the activity is destroyed and then re-created. Thus all the code in the onCreate function will run again. So here's my situation: I have an app that I am working on where it logs into a website, retrieves data, and displays it to the user. While this is all done in background threads, the code that starts these threads is in the onCreate function. Now, the problem lies in that whenever the user changes the screen orientation, the app will log in, retrieve the data, and display it to the user again. What I would like to do is set a boolean that tells the app if it is logged in or not so it knows whether or not it must log in when the onCreate function is called. So long as the app is in memory the HttpClient will exist and contain the cookies from logging the user in but when the app is killed by the system those will go away. So I would assume that I need to do something like setting the logged in boolean to false when the app is killed but since onDestroy is called when the screen is rotated how is this possible? I also looked into the finalize function and isFinishing() but those seem to not be working.

Shorter version: How can I distinguish between when an app is being killed from memory from when an activity is being rotated and different code for each event?

View 2 Replies View Related

Android :: Change Emulator Screen Orientation To Landscape / Portrait?

Jan 2, 2010

How do we change emulator screen orientation to landscape or portrait?

View 2 Replies View Related

Android :: Show AlertDialog On Activity Start - But Not On Screen Orientation Change

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

Android :: Change Screen Orientation When Call Is Ongoing / Phone Process Will Crash

Jun 15, 2009

I found if change screen orientation continouously when a call is ongoing, that is, portrait -> landscape -> portrait- >landscape.

View 3 Replies View Related

Android :: Unbind Remote Service In OnDestroy Of Activity On Screen Orientation Change

Nov 24, 2010

In onCreate method of Activity, it binds to a remote service and makes use of AIDL intefaces. Is it required to unbind from the remote service when onDestroy is called on screen orientation change.?

If the activity un-bounded from the remote service in onDestroy and if no other contexts are bound to remote service, is remote service likely to get stopped losing the state that it maintains.?

View 1 Replies View Related

Android :: Orientation Change - Dialog Above Activity With Fixed Orientation

May 14, 2009

I have created an activity for my game which handles all orientation changes by itself and has a fixed "portrait" layout. Actually it uses the accelerometer and is rendered using 2D canvas methods. If the level has been completed I show up a highscore dialog in which the user can enter his name. The dialog is floating above the underlying level screen which gets blurred out nicely. This generally works.

Problem is that the dialog does not get rotated if the orientation of the phone changes. So even if the keyboard is exposed the dialog is shown in portrait mode instead of landscape. I have tried to use an activity with dialog theme instead but the behavior didn't change. After several tries it seems that I have found the reason for this: Once there's an activity with fixed orientation in the activity stack then all subsequent activities keep this orientation, too. They will not react on orientation changes anymore (e.g. if the keyboard gets exposed).

After upgrading to 1.5 SDK the described behavior changed a little bit. Now at subactivities indead react on orientation changes like expected. However, the need to have an opaque background! That means that neither dialogs nor activities with dialog theme will work. Those will stick with the orientation of the underlaying activity. So my workaround is to first start a sub-activity with an opaque black background. This activity then shows my highscore dialog on top. It looks quite okay but I wonder if there's a better solution? Is it possible to show a dialog above a fixed portrait or landscape activity which automatically adapts to orientation changes?

View 3 Replies View Related

Android :: Screen Orientation / Shake Cellphone Crashes Application

Jan 15, 2010

I am having search application, which loads data retreived from the webservice.While application on create it shows progress dialog once its done with loading data it dismiss the progress dialog.problem is while loading if i change the orientation of the phone it works fine it try to load activity again, but if i start shaking the cellphone while it is loading data application get crashed, any solution?

View 1 Replies View Related

Android :: How To Handle Screen Orientation Change / When Progress Dialog And Background Thread Active?

Jul 10, 2009

My program does some network activity in a background thread. Before starting, it pops up a progress dialog. The dialog is dismissed on the handler.This all works fine, except when screen orientation changes while the dialog is up (and the background thread is going). At this point the app either crashes, or deadlocks, or gets into a weird stage where the app does not work at all until all the threads have been killed.How can I handle the screen orientation change gracefully?

View 9 Replies View Related

Android :: Screen Flip Doesn't Trigger An Orientation Change And Activity Destruction/recreation

Aug 29, 2010

I'm testing an app on a Droid. It's a kind of card matching game. I'd like to keep the cards physically located in the same place on the screen regardless of a screen rotation. For example, I can put my thumb on a card, rotate the phone any way I please and the card stays fixed under my thumb. However, the orientation of the content of the card will change to match the current phone rotation. I handle this by transforming the card grid in onCreate. This works fine for 90 degree rotations, but if I do a fast 180 degree flip from one landscape mode to another the screen simply flips and the Activity is NOT destroyed and recreated.

This seems contrary to the documentation:

http://developer.android.com/reference/android/R.attr.html#configChanges

"public static final int configChanges Since: API Level 1

Specify one or more configuration changes that the activity will handle itself. If not specified, the activity will be restarted if any of these configuration changes happen in the system. Otherwise, the activity will remain running and its Activity.onConfigurationChanged method called with the new configuration. "

I am NOT specifying any configChanges in my AndroidManifest.xml file, so it seems that the activity SHOULD be destroyed and recreated. Why isn't it? Is there some way I specify that it should be destroy/ recreated?

View 7 Replies View Related

Android :: Android - Orientation Change - Exits Application But Without Crashing

Sep 2, 2010

I have two layouts: layout-port and layout-land. If I run the app with emulator or device, either vertically or horizontally, the app runs fine with the correct layouts. However, if I rotate either the emulator or device, the app exits. There's no crashing, perse', it just exits. I have other app's with similarly defined layouts that work fine without any orientation handling in the manifest. I'm not concerned about persisting data.

The main differences between the one's that work and this one are (this one has):

* Menus with sub-menus
* Dialog screens (not the android dialog widget)
* Tab widget

All of the above items work in their respective layouts (port and land), the app just exits when rotating the emulator or device and I need to restart the app.

View 2 Replies View Related

Android :: Android Application Resets On Orientation Change?

May 5, 2010

So I am making a basic chess app to play around with some various elements of android programming and so far I am learning a lot, but this time I am lost. When the orientation of the emulator changes the activity gets reset. Based on my research the same thing will happen anytime the application is paused/interrupted, ie. keyboard change, phone call, hitting the home key etc. Obviously, it is not viable to have a chess game constantly reset, so once again I find myself needing to learn how to fix this problem.

My research brings up a few main things, overriding the onPaused method in my Activity, listening for Orientation, Keyboard changes in my manifest (via android:configChanges), using Parcelables, or Serialization. I have looked up a lot of sample code using Pacelables, but to be honest it is too confusing. Maybe coming back tomorrow with fresh eyes will be beneficial, but right now the more I look at Parcelables the less sense it makes.

My application utilizes a Board object, which has 64 Cell Objects(in an 8x8 2D array), and each cell has a Piece Object, either an actual piece or null if the space is empty. Assuming that I use either Parcelable or Serialization I am assuming that I would have to Parcelize or Serialize each class, Board, Cell, and Piece. First and foremost, is Parcelable or Serialization even the right thing to be looking at for this problem? If so is either Parcelable or Serializable preferred for this? And am I correct in assuming that each of the three objects would have to be Parceled/Serialized? Finally, does anybody have a link to a simple to understand Parcelable tutorial? Anything to help me understand, and stop further headaches down the road when my application expands even further.

View 6 Replies View Related

Android :: Android Application Restarts On Orientation Change

Nov 2, 2010

When I change orientation application restarts and I lost my current data.. I am using activity group which contain lots of activities when i change orientation application restarts from main activity. is it possible to avoid this application restart on orientation change?

View 3 Replies View Related

Android :: Change Android Home Screen Orientation By Program

Nov 25, 2009

I got a question about screen orientation in Android Home screen. The scenario is as following. A G-sensor detects the movement on the device. Then it rotates the screen. If the device is portrait mode, the system sets to landscape mode. With G-sensor, theres is a SensorService to detect that and do some things to reach the function. I want to know how to reach that? Is there a API or a event to do that? I means that hall system, not a activity!

View 4 Replies View Related

Android :: Android - Dealing With Dialog On Screen Orientation Change

Jun 10, 2010

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:.................

View 3 Replies View Related

Android :: Android - Screen Orientation Change To Switch Between Activities

Nov 12, 2010

I'm new to Android development. I'm trying to use the orientation change to switch between two activities. My idea is to use three Activities one TabActivity and a normal Activity. Here is some pseudo code:

public class Main extends Activity{
// this is the entry point into my app
@Override
public void onCreate(...){
if(this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE){
// Start Activity1
} else { //Start Activity2}..............

I'm taking a different approach. As i need a TabActivity, because i want to be able to start different activities in my tabs (I think i have to use a TabActivity in this case). I've edited the Manifest.xml and added android.configChanges="orientation" for the TabActivity and the second Activity. Then I've overridden the onConfigurationChanged() functions. With this approach I'm able to switch from landscape (this is the "normal" activity") to portrait (the TabActivity). The other way round does not work and i don't know why yet. I've exactly the same onConfigurationChanged functions (Copy & Pasted) and only changed the essential parts. Overriding the onConfigurationChanged of the Activities started in the tabs has no effect, too.

View 1 Replies View Related

Motorola Droid :: Make Screen Lock During Phone Calls / Change Call Screen Altogether?

Jan 18, 2010

I am going crazy here... I've had this thing since it launched and everything is great except I keep hitting buttons with my face during calls! I mute, sometimes end calls, start 3 way calls etc and I have no idea how to prevent it. Is there any way I can make the screen lock during phone calls or change the call screen altogether?

View 12 Replies View Related

Android :: Change Intent Bundle Data Before Activity Recreated After Orientation Change

Jul 30, 2009

I have a notification that starts my activity and passes a messages using the intent's putExtra() function. The message is then displayed to the user in the activity's onCreate function. When the application is restarted due to a orientation change, the message is shown again as it is still in the intent's bundled data.
How can I remove the extra data?

I tried the following:

Bundle bundle = getIntent().getExtras();
if (bundle.getBoolean("showMessage")) {
// ... show message that is in bundle.getString("message")
// remove message
bundle.remove("showMessage");
}

But the message will still be shown after the orientation changed, seems like the intent used is not the one I changed, but the original one. The only workaround I found is to save the showMessage additionally in onSaveInstanceState(). Is there another way? Or is this the way to go?

View 2 Replies View Related

Android :: Change Order Of Screens / Move Current Screen 7 And Make It 2

Oct 30, 2010

Is there a quick way to change the order of the screens? For example, I'd like to move my current screen 7 and make it screen 2.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved