Android :: Refreshing A Spinner
Jul 3, 2010
I have a view with a spinner. The activity starts another acvitity with a popup where I add or delete values that the parent shows in the Spinner.
So, in onActivityResult() I refresh the content of the Spinner so that it reflects any additional or deleted values, by calling my fillSpinner() method.
The parameter to this method is the previously selected value:
CODE:..........
When I open the Spinner, it contains the correct list (i.e. it was refreshed) and the correct value is selected. However, the Spinner control itself (in its closed state) does not show the selected value, but the first in the list.
When I step through the code in the debugger, the Spinner value is correct before and after I call setSelection() (and it is always called with the same correct id). However, since I cannot step out of the event, when I resume the execution after a short moment the value in the Spinner changes.
In other words, the spinner's displayed string is changed and is different from the selected item when I return from my popup activity.
View 1 Replies
May 20, 2010
I use this code to generate a spinner in my app:
code:.........
On my device (Motorola Milestone) and in the emulator this looks like the standard gray spinner widget.
On of my colleagues uses a Motorola Backflip and on his device the Spinner is black. Now its very hard to read the font in the spinner.
What do I have to do to use my own view for the spinner? I don't mind to have the gray spinner on all devices, but it should always look the same on all devices.
View 1 Replies
View Related
Jun 9, 2010
I have an xml layout file which contains a few widgets including a Spinner
I want to display a list of strings in the spinner, the list is generated at runtime as a result of a function so it can not be in arrays.xml.
I tried doing:
CODE:...........
But this crashes my application.
View 1 Replies
View Related
Jan 25, 2010
I have a spinner 'aperture' set up with a list of numbers, and a spinner 'mode' with two options. When a button is pushed I need a calculation to run using various inputs, including the current selection from 'aperture' and a value derived from 'mode'. How do I call the value of a spinner so I can use it in a calculation?
Also, how do I use the spinner 'mode's selection to set this other value before implimenting it in the calculation? To be more specific, if the spinner is set to Small then the value I use in the calculation is 0.015, whereas if Large is selected I need to use 0.028
My other inputs are EditText views, so right now I am set up like this:
CODE:............
That is not the actual equation, it is just a test to make sure everything connects properly. How would I call the value of spinner 'aperture' and the Small/Large spinner 'mode'
View 4 Replies
View Related
Jan 25, 2010
I have a spinner widget in my activity which lets users pick a list name.
Normally, the function of the spinner is to switch between lists but for a couple of instances, I swap out the selection change listener to perform a different function with the same list of options. Once the selection has been made, the old listener is restored and life goes on.
This is a bad and buggy arrangement. Instead, I would like to have a function that just takes a selection listener and some other parameters and shows a popup list that's populated by the same cursor (or and identical cursor) as the spinner, without using the spinner itself.
Is there any way I can do this?
View 1 Replies
View Related
Jun 21, 2009
I am trying to populate a spinner depending on another spinner's selected item, my code is the following:
CODE:.................
what is intriguing me is that the first spinner onitemselection works perfectly ( I can see the values in LogCat) then when I change selection of the 2nd spinner I am gettging an error on this line: String selected= (String) s2.getSelectedItem(); So the compiler gets insisde then onItemSelected function of the 2nd spinner but throws an Handler exceltion on s2.getSelectedItem()
why? it works perfectly for the 1st spinner.
View 4 Replies
View Related
Jun 22, 2009
I am trying (as many are doing) to populate a 2nd spinner out of the first spinner selected item like this:..............
View 3 Replies
View Related
May 25, 2010
I'm trying to develop a small app, that can retrieve GPS coordinates, and store them, so I can retrace the path I took. The thing is, the GPS on Android emulator is kind of screwing around with my nerves... First of all, the Mock Position system doesn't work, so I'm manually fixing the coordinates with telnet "geo fix" command. Second of all, the location listener seems to not be refreshing. I'm lauching the app, fixing a first set of coordinates, and observing the response I expect. But when I push a second set of coordinates, the app simply doesn't react.
I tried a lot -big lot- of ideas on this, and I'm kind of running short...
By the way, I'm developping on Eclipse with ADT, and the SDK for Android 1.5 (French HTC Heros are still with Android 1.5) so that I can use my own app.
Here's my code (just the coordinate retrieval part) :
CODE:.................
View 3 Replies
View Related
Jul 7, 2010
I have a listview that's populated by rows that get their data from a web server. It all works totally fine except I want to have a refresh button to re-download the data. I'm getting the data through an asynctask (getting the data in doinbackground) and then setting the listadapter in onpostexecute. All I do to run the asynctask which should take care of everything is run
new PopulateListTask().execute();
However, in my optionsSelect method, creating a new asynctask just like I did in oncreate doesn't do anything. It doesn't even enter doInBackground. I've tried using listView.invalidate() and listView.invalidateViews(). Is there some special way I'm supposed to repopulate a listview?
My only guess is that since I'm using a custom adapter, my getView method is creating some kind of error, but that wouldn't explain why it's not even entering my asynctask's doInBackground method. Thoughts?
Posting some code. This is a trimmed down version.
CODE:............
I'm getting this in my logcat when executing my asynctask the 2nd time. Any idea what it means? I tried googling to no avail.
View 1 Replies
View Related
Aug 23, 2010
I created an Activity which allows navigating between pages with a couple of Buttons (Previous and Next). When the user clicks one of the buttons, the Activity (same) needs to be "refreshed". In order to do this, I set up the buttons to make a call to onCreate(this); after they set up the other stuff that the activity uses for the paging to work. And it is working so far, but I'm wondering if there is a better way. Is there?
View 3 Replies
View Related
Aug 18, 2009
I have a TabActivity based class which has 3 tabs. All are ListActivities (but that's not important for this problem)
I'm updating the TabHost's TabSpec's to change the text on the tabs. This works fine and the ListActivities display correctly.
Iater on the execution flow I need to update the Text on the tabs from "Current Text" to "Current Text (3)", for example. I update the TabSpec.setIndicator() with the new text, and attempt to call invalidate() on the TabWidget (and all it's children). But the tab text refuses to update!
View 5 Replies
View Related
Feb 21, 2010
Anyone else having problems with the Weather Widgets app clock not refreshing? The weather seems to do its job every 30 minutes, but the clock gets stuck at times. Like today, it was 3 hours off. Anyone know of a fix for this? I checked for updates, but no luck.
View 4 Replies
View Related
May 24, 2010
I need to refresh my listview on my activity whenever i remove an item. I tried to call the activity (startActivity(Intent) ) it works but i lose the tabwidget.How Can I refresh my list without any lost ?
View 10 Replies
View Related
Nov 20, 2009
I'm running into some issues here with my app. I have 4 tabs run through a tabActivity. One tab sends an intent and run my ListActivity that populates the screen from a simpleCursorAdapter. My problem is that when I change back to this tab, after the first time its run, the list never refreshes regardless of the changes made to the database via other tabs. Is there something I can call from onTabChanged to refresh my ListActivity?
View 3 Replies
View Related
Sep 20, 2010
In the Settings menu, there is an "Auto Refresh" option which you can set to "Never," but there is also a "Ticker Refresh" option which you can't turn off. What do each of these things control? Is the Auto Refresh just for when the app is running? Does it affect the widget at all?
Does the Ticker Refresh option only affect the widget? Does it have any effect if the widget is not being used on any homescreen?
View 1 Replies
View Related
Apr 24, 2010
My problem is when I want to refresh data in ExpandableListView while being in that current activity. I create adapter and when I want to add new data to list I call again constructor of that adapter(it is my private variable) with all new data....and then I call onContentChanged() method to redraw my list.
But what happens is that I cant expand my list any more...like it is blocked or something and logcat isn't saying anything...
This is the code that i call after setting new data in arraylists and maps:
CODE:....................
View 1 Replies
View Related
Aug 17, 2010
I created a ListView that contains a row which in turn contain text and a button. The idea is to have the button function as a delete button to remove the row from the list as well as the database. I order to do this I created an adapter to handle the button click. This code is below. Deleting the database record works fine, but I have not yet succeeded in refreshing the ListView so the record will no longer be displayed.
public class FeedArrayAdapter extends ArrayAdapter {
private ARssEReaderDBAdapter dba;
private String TAG = "FeedArrayAdapter";
private View v;
private ListView feedList;..............
View 1 Replies
View Related
Oct 2, 2009
I've got an App Widget that gets updated (er... I try to update it) with the following chunk of code: ComponentName thisWidget = new ComponentName(context, MyAppWidgetProvider.class); AppWidgetManager manager = AppWidgetManager.getInstance(context); manager.updateAppWidget(thisWidget, remoteViews);
The problem I'm seeing is that it the user interface is updating always one behind (i.e. using the previous remoteView to update the user interface). So, i make that call with a certain configuration in remoteViews, and it doesn't reflect in the UI until the next time I call it with a different remoteView. I know this is kinda vague and I don't have a lot of details here, but i was wondering if I'm missing something very obvious.
View 2 Replies
View Related
Mar 29, 2010
I want code for refershing my page automatically when i click on any button.For Ex I have a people page In that page i delete people from total peoples using one button but that selected people is not deleted immediately That means the People page is not refreshing.So,I want code for refreshing that page.Give me any suggestions.Thanks in advance
View 1 Replies
View Related
Mar 18, 2010
I'm trying to add views dynamically to a linearlayout. I see through getChildCount() that the views are added to the layout, but even calling invalidate() on the layout doesn't give me the childs showed up.
View 1 Replies
View Related
Sep 29, 2010
I have a Moto Droid 2.2 with "Alarm Clock Plus v2" set as my clock when in the multi-media dock. The weather information will load the current weather when the application first starts up, however will not refresh.
If I tap on the weather it will open the weather info with up to date info but going back to the clock will still show the old data. By removing the phone from the dock (thus exiting Alarm Clock Plus) and putting it back on the dock (thus running Alarm Clock Plus again) the weather info becomes current.
Has anyone else run into this? I looked in the settings for Alarm Clock Plus v2 and could not find any information on how often to refresh the weather info.
View 1 Replies
View Related
Jul 29, 2010
I have created an option menu which also has a sub menu. In the sub menu I have a setting for enabling/disabling images in my application based on the application level flag that i change based on the option being clicked.What I am observing is that when i click on the "Menu" and change the settings from enable Images to disable Images. its not reflecting.I have put the debug log and what have been seen is the onOptionCreateMenu method is getting called only one time- first time when i click the "Menu" button. That is the reason the changed sub menu is not getting reflected.My question is that is there a way i can re-create the option menu every time user presses the "Menu Button".
View 3 Replies
View Related
Mar 26, 2010
How do you stop the Droid Eris mail from not keep checking for new mail? I tried clicking stop and closing it but it still keeps refreshing all new email. Any help to stop this action?
View 5 Replies
View Related
Jun 13, 2010
This Android application on Google uses the following method to refresh the database after replacing the database file with a backup:
CODE:...........
I did not build this app, and I am not sure what happens. I am trying to make this idea work in my own application, but the data appears to be cached by the views, and the app continues to show data from the database that was replaced, even after I call cleanup() and reopen the database. I have to terminate and restart the activity in order to see the new data.
I tried to call invalidate on my TabHost view, which pretty much contains everything. I thought that the views would redraw and refresh their underlying data, but this did also not have the expected result.
I ended up restarting the activity programmatically, which works, but this seems to be a drastic measure. Is there a better way?
View 1 Replies
View Related
Jan 11, 2010
Is anyone else finding that their Facebook notifications page will NOT refresh?
Mine has been stuck since Jan 6 (only that page) and g I can just go to the website, it's downright annoying.
View 8 Replies
View Related
Nov 8, 2010
I have set up Eclipse to run as smoothly as possible because I was having a lot of problems with it running out of memory in my last machine. One of the configurations was to have it automatically refresh the workspace every time I save. I don't know if that is the problem but I thought I's mention it. Here's a screenshot of the error:
It happens every time I open Eclipse and save anything. I was also having another problem with something to do with my workspace being compliant with Java 1.6 when I need 1.5. But then I switched and the problem went away. This problem then popped up. Does anyone know any solution to this because it is really getting annoying now.
View 4 Replies
View Related
Sep 11, 2009
This is a very common scenario: displaying images in a ListView which have to be downloaded from the internet.Right now I have a custom subclass of ArrayAdapter which I use for the ListView. In my getView() implementation of the ArrayAdapter, I spawn a separate thread to load an image. After the loading is done, it looks up the appropriate ImageView and sets the image with ImageView.setImageDrawable(). So the solution I used is kind of similar to this one: http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listviewThe problem I'm having is that as soon as I make the call to setImageDrawable() on the ImageView, the ListView somehow refreshes all currently visible rows in the list! This results in kind of an infinite loop. Code...
View 2 Replies
View Related
Apr 22, 2010
I'm trying to write code that draws accuracy circles around a gps location based on a time param. I have no problem setting up the GPS, or of calculating how to draw the circles.What's been killing me is that the Overlays always overwrite one another.So I can never have more than one circle.I've looked at all the examples and tutorials online but they seem to be obsessed with putting in icons or with Drawing from some database or array.If I understood correctly I should be able to do itemizedoverlays and just draw as i go without having to track each readout in an array.
View 9 Replies
View Related
Sep 15, 2010
the Facebook for android apps of the htc desire is not receiving notifications. When i refresh the page of the notifications, a error will occur. All the rest can be used except for the notifications. Anyone has the same problems? or if you know the solution kindly help.
View 5 Replies
View Related
Sep 10, 2010
How do you refresh a web page in the stock browser? Am I missing something, seems like this should be basic functionality?
View 6 Replies
View Related