[android-developers] Re: Tips for Orientation

2008-11-19 Thread Blake B.
Put the android:screenOrientation=sensor as an attribute on each activity in your manifest that you want to be sensor-oriented. Works great! Thx for the tip hackbod! On Nov 18, 3:14 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Will this setting make the screen change to lanscape using

[android-developers] Re: Tips for Orientation

2008-11-18 Thread [EMAIL PROTECTED]
Hi, Will this setting make the screen change to lanscape using the accelerometer? If so, where do I put this setting? Thanks On Oct 20, 5:37 pm, hackbod [EMAIL PROTECTED] wrote: Don't do that, or moving between your app and others will be flicker. Just use android:screenOrientation=sensor.

[android-developers] Re: Tips for Orientation

2008-11-18 Thread Dianne Hackbod
Yes, you use exactly what I wrote. On Tue, Nov 18, 2008 at 1:14 PM, [EMAIL PROTECTED] [EMAIL PROTECTED]wrote: Hi, Will this setting make the screen change to lanscape using the accelerometer? If so, where do I put this setting? Thanks On Oct 20, 5:37 pm, hackbod [EMAIL PROTECTED] wrote:

[android-developers] Re: Tips for Orientation

2008-11-04 Thread Cheryl Sedota
FYI: I have a bug open against Android for not respecting the activity's request to handle orientation changes itself: http://code.google.com/p/android/issues/detail?id=969 On Oct 30, 7:01 am, Mark Hansen [EMAIL PROTECTED] wrote: You need to store whatever information determines the state of

[android-developers] Re: Tips for Orientation

2008-10-30 Thread Imran
Haii Al... The activity gets restarted when the mode changes form landscape to portrait or vice-versa is there any way to stop the activity getting restarted. help me out guys Thanks in advance for any Replays..!! Cheers Imran On Oct 25, 1:21 am, Peli [EMAIL

[android-developers] Re: Tips for Orientation

2008-10-30 Thread Mark Hansen
You need to store whatever information determines the state of your application, use the following overrides: @Override public void onSaveInstanceState(Bundle savedInstanceState) { // example savedInstanceState.putString(someKey, someString); } then on the load: @Override public void

[android-developers] Re: Tips for Orientation

2008-10-24 Thread ksmith44
As a followup, I have now found at least 3 ways do determine the orientation, all of which use different constants with different values. * There is the aforementioned Activity.getRequestedOrientation which uses the ActivityInfo constants wherein landscape=0 and portrait=1 * Then there is

[android-developers] Re: Tips for Orientation

2008-10-24 Thread Mark Hansen
Setting this android:screenOrientation=sensor as mentioned above worked perfect.. it switched the view as the phone changed. I then only created alternate XML files for the layouts that needed tweaking and it worked like a charm. On Oct 24, 2:24 pm, ksmith44 [EMAIL PROTECTED] wrote: As a

[android-developers] Re: Tips for Orientation

2008-10-24 Thread ksmith44
Right. I have done that too, and it works great. The problem is that aside from using a different layout, my Activity actually needs to do slightly different logic bassed on the orientation, (it builds its options menu differently for landscape than for portrait), which means I need to be able

[android-developers] Re: Tips for Orientation

2008-10-24 Thread Peli
You could use yet another method: :-) Define a textview with id=R.id.text_portrait in your portrait layout, and in the landscape layout as R.id.text_landscape. Now, if findViewById(R.id.text_portrait) returns null, you know that currently the landscape layout is being displayed :-) But

[android-developers] Re: Tips for Orientation

2008-10-22 Thread blindfold
Thanks hackbod! I too had not been aware of this. I was about to deploy it, until I realized that blind users of my app could be inadvertently changing physical orientation, each time causing a soft reset of my app with associated hickups through the repeated calls to onCreate(). Guess I should

[android-developers] Re: Tips for Orientation

2008-10-21 Thread Tauno T
I searched the documentation for this kind of functionality but I overlook that one completely :( Thanks for pointing that one out! That's exactly what I was looking for. Tauno On Oct 21, 1:37 am, hackbod [EMAIL PROTECTED] wrote: Don't do that, or moving between your app and others will be

[android-developers] Re: Tips for Orientation

2008-10-20 Thread Mark Hansen
I've actually created layouts for both vertical and horizontal views, I've had some people testing it and it turns out Android doesn't turn the view, I guess it has to be detected? I was curious how to go about doing that detection.. I know I can also set the view with:

[android-developers] Re: Tips for Orientation

2008-10-20 Thread Mark Murphy
Mark Hansen wrote: I've actually created layouts for both vertical and horizontal views, I've had some people testing it and it turns out Android doesn't turn the view, I guess it has to be detected? I was curious how to go about doing that detection.. I know I can also set the view with:

[android-developers] Re: Tips for Orientation

2008-10-20 Thread Xolotl Loki
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The problem I'm having is what event to trap or how to go about determining which way the phone is being held. The following should work from within an activity: SensorManager sensors = (SensorManager)getSystemService(SENSOR_SERVICE);

[android-developers] Re: Tips for Orientation

2008-10-20 Thread hackbod
I don't know what you mean by turn the view. When the orientation changes to switch from the dominant to secondary orientation (portrait to landscape on the g1), the graphics of the entire screen are rotated to result in the screen being shown in the new orientation. As such, there is no need

[android-developers] Re: Tips for Orientation

2008-10-20 Thread Mark Hansen
From what I was told by a user of my application, that it did not change view, even when the keyboard was opened for text entry. I've built two set's of layout files, and stored them in layout and layout-land for when the view changes. In emulator mode they work fine, CTRL-F12 works fine.. but,

[android-developers] Re: Tips for Orientation

2008-10-20 Thread hackbod
Your user is confused. The standard orientation policy is to select the orientation based on the keyboard: when the keyboard is closed it is portrait, when open it is landscape. Pressing Ctrl+F12 in the emulator is exactly the same as sliding the keyboard out on the G1. On Oct 20, 11:57 am,

[android-developers] Re: Tips for Orientation

2008-10-20 Thread Tauno T
And that's why he want's to set the orientation programmatically - the users expect that when the phone is turned sideways then the picture is also turned sideways:) The user is not confused - he just thinks that Android has a feature that it does not have (sadly). As for the solution - Xolotl

[android-developers] Re: Tips for Orientation

2008-10-20 Thread hackbod
Don't do that, or moving between your app and others will be flicker. Just use android:screenOrientation=sensor. On Oct 20, 12:47 pm, Tauno T [EMAIL PROTECTED] wrote: And that's why he want's to set the orientation programmatically - the users expect that when the phone is turned sideways then

[android-developers] Re: Tips for Orientation

2008-10-20 Thread Mark Hansen
That looks like it! Thanks! On Oct 20, 6:37 pm, hackbod [EMAIL PROTECTED] wrote: Don't do that, or moving between your app and others will be flicker. Just use android:screenOrientation=sensor. On Oct 20, 12:47 pm, Tauno T [EMAIL PROTECTED] wrote: And that's why he want's to set the

[android-developers] Re: Tips for Orientation

2008-10-19 Thread hackbod
Use the android:screenOrientation attribute when declaring your manifest: http://code.google.com/android/reference/android/R.styleable.html#AndroidManifestActivity http://code.google.com/android/reference/android/R.styleable.html#AndroidManifestActivity_screenOrientation On Oct 19, 3:23 pm,