Android :: How To Get A Widget To Recognize When Phones Orientation Has Changed
Apr 9, 2010
I want my widget to update when the phones orientation has changed. Before android 2.0 you could register your widget to get the intent on orientation change. Code...
View 1 Replies
Jul 28, 2010
I'm facing some problems with the progress dialogs. I use a managed progress dialog to show the user that an operation is being carried out with the following code written in the onCreateDialog(int id) function.When the operation completes I call dismissDialog(PROGRESS_DIALOG). The problem is that if I rotate the phone while the progress dialog is displayed then when the operation completes the dismiss call has no effect and the progress remains showing. And this I cannot understand why.
View 1 Replies
View Related
Feb 27, 2009
I have a program with two layouts: - layout/main.xml - layout-land/main.xml
Also, i have some images en drawable and drawable-land...
My problem is: When i change the orientation of the emulator (for examplo: portrait to landscape) i don't know how reload the main.xml layout to update the screen with the new positions....
If I launch the emulator in portrait the application load the portrait layout, and if I launch the emulator in landscape mode the application load the landscape layout, but if I change the orientation in execution mode the application don't load the new layout...
How can I reload the layout?
View 3 Replies
View Related
Jun 23, 2010
My activity use the same RelativeLayout as it's content view whatever the orientation is. In this RelativeLayout, there is a FrameLayout align to it's bottom, and a TextView above this FrameLayout, just like :
CODE:...........
on android 1.5 device when orientation changed, the TextView lies in the wrong place, middle when portrait, bottom when landscape. on android 1.6 device It is ok.
How could I make it lies in the place where it should be on 1.5 device?
View 2 Replies
View Related
Nov 18, 2010
I snap a photo, and it gets placed onto an ImageView. When the user sees the page where the Image View is, and I turn the phone sideways where the orientation is horizontal, the app immediately returns to the app's main screen.
View 1 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
Jun 21, 2010
In my application result displayed in Text view is disappeared when mobile orientation is changed,for this what can i do.i want my application in both modes means portrait and landscape.for this what can i do.
View 2 Replies
View Related
Oct 1, 2009
I get an OutOfMemoryError in my app after changing the orientation. I have read, that if have to use Context.getApplicationContext() instead of a normal activity context??
My java file looks like:
CODE:.....................
View 11 Replies
View Related
Aug 16, 2010
I am having a listview in my App which shows perfectly in Portrait mode. But when I change orientation to landscape, sometimes the width remains as that of Portrait mode. Even the scrollbar for the list comes at the center and remaining part of the screen remains blacked out. This happens only with the list view. Other views show perfectly. I have designed the layouts such that the Portrait layouts look feel proportionate in landscape mode. I want to avoid restarting the activity so I have not put the layouts in the landscape folder. I tried invalidating the listview in onConfigurationChanged() but of no use. When I navigate in the list in landscape mode, the width automatically gets adjusted.
View 2 Replies
View Related
Dec 14, 2009
I got my hands on Android which is really fun. But at some point I don't seem to understand the concept. I've got a Main class which reads like this:
CODE:....
In the onCreate(...) I set the layout to setContentView(R.layout.main); and add an OnTouchEvent Listener to the sole View in main.xml: myView.setOnTouchListener(new OnTouchListener() {@Override public boolean onTouch(View v, MotionEvent event){...
As you can see I also implemented a SensorEventListener which is used if required. All works fine so far.
But my problem is this (at this point my misunderstanding kicks in): whenever I rotate the device the onCreate(), onStart() etc. methods are called, causing my app to act as if it just started. Furthermore, I feel unable to implement an onSizeChanged(int w, int h, int oldw, int oldh) { ... } Listener.
Can anyone please explain where my error in reasoning is? I am working on a tiny app which is more or less done, except for the just mentioned bug(s). Maybe I got it all wrong but it does what it is supposed to do (i.e. sending touch positions and accelerometer data over the network via UDP).
View 14 Replies
View Related
Sep 1, 2009
I've built an app widget a fairly simple one that draws an image inside a frame. (If that sounds familiar, that's because it's very similar to the built-in one, but it's a start to something else.)The RemoteView consists of little more than a FrameView and an ImageView. I have a second FrameView that may display or not depending on some certain state awareness.The Image updates on an Alarm schedule rather than the built-in mechanism so the user can adjust this value after installation. The image is set on the RemoteView using a drawable ID from included resources in the package. They've been resized to approximately a quarter of the screen size, but might still be scaled a little by the ImageView.All of this has been working fine. There is one issue that I've been unable to diagnose even the root of the problem.
After an orientation change when the home screen redraws, the ImageView doesn't always draw. The rest of the RemoteView does draw just as it was set during the most recent Update.The mystery is that the ImageView does, in fact, draw if the Alarm is currently set. If it's not currently set, it doesn't draw. Nothing else seems to affect whether it draws or not. It doesn't matter if the widget process is running or not, either (killing it via DDMS and then rotating has the same effect).This occurs in the emulator as well as the G1. During a rotate, the widget gets no update event at all.I could set it to listen for configuration changed broadcasts, but since it works in one of the cases, I suspect something else is going on and that's just an unnecessary piece of duct tape.
View 12 Replies
View Related
May 2, 2010
Is there a way to change the title of the widget/icon located on the Home screens?
View 2 Replies
View Related
Oct 14, 2010
I have a samsung tablet.I have a test widget.When I change orientation the widget disappears, but is actually still there (I can long press to remove it).in my res directory,I have resdrawable resdrawable-hdpi resdrawable-ldpi resdrawable-mdpi reslayout reslayout-land reslayout-large-land With valid values in all of these areas, but the widget just will not appear when I go into landscape mode.
View 2 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
Apr 26, 2010
I have a widget set up and it displays properly in both portrait and landscape when added to each. But when I change orientation it has the problem "Problem Loading Widget". I delete this, re-add the widget, and it displays correctly. Thus, my widget can support both portrait and landscape but it doesn't survive an orientation switch. What am I missing? Do I need to redraw the widget when orientation is changed? Doesn't it do this automatically? Do I need to call onUpdate() somehow?
View 2 Replies
View Related
Jun 19, 2009
Maybe I'm missing something obvious, but how do you handle orientation changes for a Cupcake desktop widget?When it is initially created, the onUpdate method of my AppWidgetProvider calls views.setOnClickPendingIntent(buttonID, pendingIntent) to register for my button events, but when the orientation changes, new buttons are created and I don't have an opportunity to re-register the "onClick" listeners. What is the proper way to do this?
View 6 Replies
View Related
Jul 8, 2009
I have a widget , thats working just fine in a particular orientation, but the moment i change the orientation to landscape/portrait, the widget is not able to launch. I have one layout and one layout-land folder in res directory.The problem is that the widget created in landscape mode is not opening in portrait mode and vice-versa.
View 4 Replies
View Related
Aug 17, 2010
I have two buttons on a widget that change some items in a widget, if an orientation is changed on a phone, buttons do nothing. I read http://developer.android.com/guide/topics/resources/runtime-changes.html but this is all about activity not widget.
View 1 Replies
View Related
Aug 14, 2010
I am generating the random numbers and do some functionality with that .but when i change the orientation new random numbers are coming.But I want portrait random numbers.For this give me some suggestions.
View 1 Replies
View Related
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
Jul 12, 2009
I'd like to report a bug we just found while writing a widget.
Summary: There is a widget installed, that defines a configuration activity. If the user changes the orientation while they are in the configuration activity, and they finish that activity in a different orientation that they started, the widget does NOT appear in the home screen after the configuration is done.
How to reproduce: have a minimal widget, with a configuration activity that contains a button, which correctly updates the App Widget when it is clicked (as explained in http://developer.android.com/guide/topics/appwidgets/index.html#Confi...). Add a new instance of the widget, so the config screen shows up. Change the orientation once. Click on the button. Your widget does not appear in the home screen. (Ouch.)
If this has already been reported, or if there's a better way to submit a bug report.
View 4 Replies
View Related
Oct 25, 2009
I just got a tattoo this week and have had a few problems, and thought I would post what I have seen so that other tattoo users can either add to the list, or respond with solutions or workarounds they have found.
1) many apps from previous android phones are not available (presumably this is because they are "incompatible with the smaller screen resolution, but I suspect that many of them are just incorrectly tagged for 1.5 sdk or earlier, but would likely still work with donut-1.6) but could easily be made available with a tiny bit of tweaking.
2) the HTC Mail widget can't be removed (or moved) from the second screen to the left on the Sense interface. Why even bother with this one over the gmail?)
3) speaking of Gmail - somehow it only accesses the messages which are actually to my gmail address, and not to other addresses which are forwarded to my gmail (and are always in my gmail inbox) do I need to install google gears to get this working (which is not, as I found out quickly "gears for android" as listed in the marketplace) as it does on my laptop?
4) All of this is would be easily solved if someone has just figured out to root this thing... I started along the hero donut instructions I had seen at unlockr, pressing the down volume rocker while turning it on.
View 13 Replies
View Related
Jul 31, 2010
It stinks that Samsung didnt make one but is it possible for a developer to make one that works with the Galaxy S default music player? I dont use a lock screen at all so I have no way of controlling the music besides going into the music player app. I am currently using Meridian player which has a music player widget btw. I plan to get the Epic 4g and want to use the samsung player, but it needs a widget
View 4 Replies
View Related
May 1, 2010
I have a (hopefully) a relatively simple question. How do I tell Android which layout to use for portrait and which layout to use for landscape orientation on my App Widget?
View 1 Replies
View Related
Mar 14, 2010
The Mrs likes the weather clock widget on my hero. Is anything identical available in the market for her Samsung?
View 6 Replies
View Related
Jul 30, 2010
Anyone know of a simple 1X1 widget that will show me the phones temperature in Fahrenheit?
I use my Dinc a lot in the car for hours at a time using GPS, Pandora and maybe other apps. Running all of them can really heat up the phone so I like to keep an eye on it. I can see the temp if I pull the notification bar down using Battery Indicator but I'd like to be able to watch this with just a glance
View 2 Replies
View Related
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
Jul 22, 2010
I have a widget which has say, a dimension of 294*72(portrait). But when the orientation is changed, I need to change this dimension of the widget to another dimension which would look good on the landscape orientation.
View 4 Replies
View Related
Aug 19, 2010
I understand how to force a specific orientation per activity in the android manifest. I would like to know if it is possible to allow the keyboard to change orientation even though the activity(the layout really) must remain unchanged.
View 1 Replies
View Related
Jul 17, 2009
I have a problem with working with the ORIENTATION values of the SensorManager. I would like to have some kind of 360°-value which directly shows me if the phone is in normal portrait (0°), landscape, portrait turned around (180°) or anything in between. So I could have, for example, an arrow that points to the floor (like gravity would do with a plummet) all the time, no matter how I tilt (sidewards) the phone. I thought this would be easy, but I'm pretty confused at the moment.
First of all, the X value of the orientation-array seems to correspondent with how I turn the phone, BUT: if it's completely uprightly standing, this value is about 60° ... why not 0° (or 90°, 180°, 270°), as I would expect?
Second: The value resets if I turn the phone and Android automatically changes screen orientation. So both in Portrait and in Landscape mode it will be sth. like 60° when the phone is in a 0° angel in real world. I set "android:screenOrientation" to "landscape" but this doesn't help anything :/
I want the app NOT to change orientation when I turn the phone, but I want it to get a continuous orientation value when I tilt the phone.
View 4 Replies
View Related