Android :: RadioButton SetChecked Not Working On Configuration Change / Get To Work
I am trying to set a RadioButton as checked/not checked through code. It is working the first time I set it, but the second time, the code does not set the button. Here is the relevant part of my code. I have commented on the problematic part. code...
View Complete Thread with Replies
Related Forum Messages:
Android :: Droid RadioButton Not Able To Set Using SetChecked Method / Fix It?
If I set a radio button to be selected on the first time, it works fine. But if I unselect it by calling
then, later even if I try to make it selected by calling setChecked(true) will not work unless the user select it from the screen.
Have any one come across this? or is it only me?code...
If the else part is executed atleast once then everything gets mess up.
When I step thro my debugger, I can see the execution goes in the correct path and setting it to true. It is getting executed only once, I checked that. And I am not resetting it back to false in any other part of the code.
Android :: Dialog Survival Over Configuration Change
Flipping between landscape and portrait is causing me a problem with dialogs that are active at the time of config change. The dialogs survive (which I think is good), but I have the problem that some of my dialogs contain dynamic content which would need to be refreshed in the dialog views. All that content disappears from the dialog views after the config change.
I thought it would be easier to do a dismissDialog() on restoration in onCreate(), letting the user press the button that shows the dialog. I successfully save and recover the dialog id, but when I attempt to dismissDialog(id) I get an IllegalArgumentException: no dialog with id 1 was ever shown via Activity$showDialog. Ok, so that doesn't work, and I still have that messed up dialog up on the screen that I want to get rid of. How can I do that? Are there any other reasonable alternatives?
Android : AlertDialog And Keyboard Open Configuration Change
My app creates and shows an AlertDialog which accepts input from the user (the user needs to type some text into an EditInput).
With the AlertDialog on screen, if the user opens up the keyboard on the device, then the app's OnCreate and OnResume methods are called and my AlertDialog promptly disappears from the screen ... not the effect I was hoping for!
I thought that perhaps I needed to override the Activity's onConfigurationChanged method, but despite having the following in my Manifest:
Android :: List View SetChecked Selects Multiple Items Instead Of One
I have a listview which populates the data using CheckedTextView.
Here is the xml
On item click listener, show tick on the right of the item, but not only that item shows tick other multiple items also show tick. Wierd thing is all are ticks after same number of row. I dont know where I am doing wrong.
Here is the code
Android :: RadioButton In ListView
I want to create a ListView with a RadioButton in every row. I'm using a CursorAdapter and I'm binding it in the right way, but I cannot manage correctly the RadioButton. I want that at any moment only one RadioButton to be checked (so when I check one, I would like the one that was checked before to uncheck). Furthermore, when I put the RadioButton on the row, I cannot manage anymore the setOnItemClickListener.
Android :: RadioButton Return A Constant?
I am trying to perform a rating system, where with the choices to select from returns a constant number so I can insert a value into a database. My intentions are to have 3 choices, 'Great', 'Mediocre' and 'Bad'. I would like Great to be a constant for '3', Mediocre to have a constant '2' and Bad to have a constant for '1'. I would like to insert only the numerical values if possible, any easy way to do this?
Android :: Add Margin Between A Radiobutton Its Label In Phone?
Is it possible to add a little bit of space between a RadioButton and the label while still using Android's built-in components? By default the text looks a little scrunched.
I've tried a couple of things:
Specifying margin and padding seem to add space around the entire element (button and text, together). That makes sense, but doesn't do what I need.
Creating a custom drawable via XML specifying images for the checked and unchecked states, then adding a few extra pixels to the right side of each image. This should work, but now you are stepping outside the default UI. (Not the end of the world, but not ideal)
Add extra whitespace to the beginning of each label. Android seems to trim a leading space character, as in " My String", but specifying unicode U+00A0, as in "u00A0My String" does the trick. This works, but it seems kinda dirty.
Any better solutions?
Android :: Pass A Radiobutton Value To Textview In Droid?
I have two activities or "screens".
The second activity has an AlertDialogBox with radiobuttons for selecting a single option.
I want that after an option has been selected from the second activity's DialogBox, it should be displayed on the first activity screen in a text-view.
That is, suppose the user chooses "Green" from the dialogbox in the second activity, then "Green" should be displayed on the first activity screen.
Whats the way to pass a radiobuttonvalue to the textview?
Android :: RadioButton And EditText Inside ListView?
I want to implement RadioButton and EditText inside a row of a ListView. I am using an ArrayAdapter to populate the List. But the problem is that when i am selecting a RadioButton and scroll down the list and scroll up again the Radiobutton which had been selected is unselected. Same with the content of the EditText. The text getting removed when I scroll up.
Android :: ListView With RadioButton In SingleChoice Mode And A Custom Row Layout
I have a ListView, which is in singleChoice mode. All I want is to display a RadioButton to the side, that when clicked highlights to say it is selected, and when a different one is clicked that one goes back to unselected and the new one becomes selected. Why is this so hard? This should not be this complicated. I've spent DAYS looking for an appropriate answer to this and I have found nothing, so I'm asking hopefully in a clear and concise manner.
My layout for the listview (R.layout.view_orders):
My custom row (R.layout.orders_row):
My onCreate() method:
Now everything underlying works as expected, you click on a radiobutton and through it's tag I can appropriately select that item from the list and manipulate it how I want. However, when the first radio button is clicked, the last one will be selected. Click that same radio button again, and it is now selected as well. Click it once more and nothing happens, both the last and the first are selected. Now I click any other one on the list, it gets selected like expected. Click anyone of the selected radio buttons and nothing happens, the radio button remains selected.
I have tried using the following in onCreate():
And that just shows no radio buttons at all. AWESOME.
Now maybe (read: most likely), I'm just dense and can't figure this out, but I've seen this question asked a lot with no real answer. Lots of references to other tutorials or to the Commonsware guy's book. However, the comments are old now and his repository has changed so much, that those are no longer correct answers.
So, does anyone have any idea how to get the expected functionality out of this? Or failing that, just pass me along the GMail app's source code.
Android :: Unsubscribe To Group Not Working / Get It To Work
I cannot unsubscribe to this group. When sending an email to the unsubscribe account, it is being rejected.
If google are reading this could you fix it? Also your ADC2 rules are unfair. Just for your information.
On Aug 21, 2009 6:40 AM, "bear tung" <beart...@gmail.com> wrote:
I want to draw some Drawables in a view, for example like Rect. Then I want to make a totate animation for each Rect when it's be clicked. I try to use RotateAnimation, but it not work. It look likes only can make a View rotating.
so, how can I make this work?
Android :: How To Setup / Implement Two Working Piece Of Software / Can Work Together Different Apps
I have tried to figure out a way of exposing(sharing) data between a master application and slave application in a secure way (not world readable), but couldn't find clues on how to do that practically. Of course, reading articles outline that ContentProviders are for sharing persistent data, but I can't find a working example, nor the information how to setup/implement two working piece of software that can work together as different apps.The data I share is simple - ID & Data.If there's anyone that already achieved this already,
HTC Hero :: Managed To Get 3G Data Working For Weather Email However Browser Does Not Work
I just bought a Telus HTC Hero, which the seller had unlocked. I intend to use this phone with another carrier, Bell. After spending a few hours at Bell customer service, they finally managed to get the 3G data working (for weather, email etc.). However, the browser does not work, neither does the Market.
What seems to be causing the problem is that this phone is MASSIVELY tweaked (appears massive to me probably because I'm not that big on tweaking and don't know about the Android OS in general) by the previous owner who only had it for a few days. The Bell customer service person told me that they switched over a couple of other HTC devices from Telus that were NOT tweaked and the data works perfectly.
All I want is for the phone to be in original factory settings, with original ROMs, firmwares, software, etc. etc. Just looking at the whole bunch of different files that this guy had on the 2GB "gold" memory card made my head spin. He attempted to explain to me with all the "updates" and fancy "roms" and "roots" and crap that I didn't understand nor do I want to spend the time to learn.
I understand that a lot of people buy android phones because they love tweaking but I am not really into all that... I just wanted the phone for the form factor and the functionality and I don't want to worry about optimizing and whatnot. So my question is: is there any way to get the phone back to the most original possible software condition? I just want it "clean." Can I go ahead and wipe everything that is on the 2 GB card? What do I do? I performed a hard reset and it took me to some weird startup screen and I chose the first option which is like reboot now (there were also a bunch of other options including apply update.zip or something)... it still gave me the same MoDaCo build.
I can provide any information but I would really appreciate any help in restoring my seemingly very tweaked phone to original, factory settings, so it could be like any other phone being sold by Telus other than the fact that it is unlocked.
Android :: Background Task / Progress Dialog / Orientation Change / Any 100% Working Solution?
I download some data from internet in background thread (I use AsyncTask) and display a progress dialog while downlaoding. Orientation changes, Activity is restarted and then my AsyncTask is completed.I want to dismiss the progess dialog and start a new Activity. But calling dismissDialog sometimes throws an exception (probably because the Activity was destroyed and new Activity hasn't been started yet).What is the best way to handle this kind of problem (updating UI from background thread that works even if user changes orientation)? Did someone from Google provide some "official solution"?
Android :: Switching Views With RadioButton And Saving Views In Bundle
I have the following XML code:.................
The idea is to change the views, whenever I press one of the radio buttons. When I press a button the first time everything works out fine, but the second time I press a button, I get an IllegalStateException, and I can't quite see why I'm getting this.
Also, the Activity seems to set all my global variables to null, which is why I have to create them every time I switch from portrait to landscape or vice versa. So I would like to know if there is a way I can save my views in the Bundle, or any other way in which I can permanently save my views, so I don't have to add or create them every time, I flip the phone. And whenever I flip the phone, it seems that it rereads the main XML file, causing the RadioGroup to be set to 2D even if the 3D button is checked. This is because I've said the 2D button to be checked from when the app is first created, but I would like to also save the state of that RadioGroup.
Android :: OTA Configuration Supported By OS?
I would like to know if the Android handsets can be configured Over-The-Air; in other words, if they can be configured for settings (such as GPRS , WAP or MMS ...) using OTA. If yes, do they support OMA CP provisioning? Is there an XML example that can be used to configure the Android devices?
Android :: Best Way To Add Configuration UI To Application?
I have a simple Android application that loads a page in a WebView, then most of the real work is done by the server-side scripts. Everything is working great, except that I currently have the page URL hard-coded in the Android application, sort of like this:
This was fine until this morning when I was asked to to make it so that the user is prompted to enter the URL the first time the application run, and the URL that is entered by the user is then saved and used automatically by the application from that point onward. I was also asked to make it so that the user can change the URL if they choose to do so. The reason I was asked to do this is so that users can install the server side of the application on their own servers and my Android application will be able to connect without me having to write a custom version for each user, with their URL hard-coded into the application.
I am unsure what is the best way to handle this in Android. It seems that I probably need to add some type of configuration interface to the application that is shown by default on the first run, then only when the Menu button is pressed on the following runs. From this configuration interface I guess I would then get the URL from the user and serialize it for future use. What is the best way to accomplish this?
HTC EVO 4G :: External Speaker Stops Working After Sounds Profile Change / Reset It?
Ok so this is the first problem I've had with my evo so far. In the last two days my external speakerhas stopped working but only after I change the profile to vib or silent then go back to normal. To get sound again I have to do a battery pull then it works again. So I have a feeling its a software issue. I wanted to know 1st if any one else has had this 2nd what do I want to use to back up to do a reset. And 3rd how do I do a reset.
Android :: Juice Defender Configuration?
I've only owned an Android for 6 days (Samsung Galaxy S i9000) and one of the first things I installed was Juice Defender, having used iPod Touch extensively, I know how heavy on battery things like WiFi can be. Anyway, JD makes the phone really really leggy. It can take a minute sometimes (literally, 45-65 seconds) for the JD screen to come up when launched. Similarly when waking from sleep it takes ages for the data connections to become active again. Have I misconfigured JD? Is it really this slow and creates this much lag? Does it just not like the (fairly new) i9000? I've just uninstalled it there right now (left Ultimate Juice on) and the phone is much snappier. It's like using it for the first time. Which, considering JD was installed in the first half hour of my owning the phone, it kind of is. What I really wanted was the WiFi on/off according to cell tower location data so I can have it go on and off when I leave the house. Guess it's no real biggie. Having limited background data (e.g. the 2 mins per 15) is handy too. Are there any other apps which have JD functions - even if more limited in scope - that I can try?
Android :: Setting APK Configuration In Activity
In Java ME we can set .jad configuration in description file and we can get this values in midlet by getAppProperti(""); So in Android we can set apk configuration (eclipse) apk configuration. But when I set this! my file default properties change and my projet signal some error. So in activity when can add System.setProeprty("name","values"). My problem I wan to specify the server IP and some code in apk only for this apk file. Each apk can have his code and server IP.
Android :: Force An Update In A Configuration Activity
I'm writing a widget with a configuration activity which calls the following method when its OK button is clicked:
This is almost verbatim from the documentation. widget_id holds the widget ID that was dug up during the activity's onCreate().
When I place an instance of the widget on the home screen, I've verified that I get the expected sequence of events:
onReceive() gets an ACTION_APPWIDGET_ENABLED if it's the first one.
onUpdate() gets called (in which I detect that the widget isn't configured and draw something as a default action).
The configuration activity appears.
When I press OK, the ok() method above gets called.
The method gets all the way through to the finish() and the configuration activity goes away, but there's no call to onUpdate() or onReceive() after this point. (The widget itself has no updatePeriodMillis.) I end up with a widget on the screen that has the results of my default action but never gets updated.
If I set the widget up without a configuration activity, it gets updated when created and everything works as expected (just without the configured bits).
Android :: Best Practice For Storing Application - Configuration
I am still learning bu find Android the cool platform for allot of useful applications. I have written a Service for doing GPS tracking and it consists of a Service and a Control activity to manage, monitor and configure the service. I am looking for the preferred way for the Control Activity to define settings for the Service, things like IP address and Update interval. I envision something like a Registry on windows where these settings can be shares and updated.
Android :: Smartphone Memory Configuration - Inbuilt ROM And RAM
Smart-phones have built in ROM and RAM separately. Also a few phones has virtual memory support too. I would like to know what these memories are basically used for. I understand that RAM is available to user processes. But why do they have a big chunk of ROM? E.g. The wiki page for Droid Incredible says
512 MB DDR RAM
1 GB ROM (748 MB free to user) - what's this free to user?
plus 8 GB moviNAND - typically used for data storage
Android :: AppWidget Configuration Activity Required?
I'm playing around with the new AppWidget API, I get the impression from the docs that I don't need an android:configuration attribute in my AppWidgetProviderInfo xml resource. Curiously though, when I try to add my AppWidget to the home screen, I just get a black textview that reads "Problem loading widget".
Android :: Keeping Service Alive Across Configuration Changes
The default way configuration changes (i.e., rotates) are handled is to destroy the activity & recreate it with a new one. What is the recommended way to handle these changes in an activity that binds / unbinds to a service (that is possibly heavy/slow to start)? When the activity gets destroyed, it unbinds & causes the service to be destroyed. When the new activity is created, it binds & recreates the service.
The only choices seem to be:
-- override onConfigurationChanged in the activity. Feels ok, but non - conformant.
-- explicitly start the service & only stop it when the last activity gets an onDestroy that's not due to a config change (i.e., there was no call to onRetainNonConfigurationInstance). Feels icky.
-- explicitly start the service & don't stop it until some amount of time after the last unbind. Ickier.
On a related note, what happens between activity switches within a process, where the first activity (A) starts the next activity (B) & then calls finish() -- is there a guarantee that B.onCreate is called before A.onDestroy? If not, and the activities share a service, the same issue of keeping the service alive during this window exists, but with only the icky workarounds.