Android :: Custom Widget Doesn't Update
May 11, 2010I'm trying to make a widget to my app, but it doesnt update.I just need to change the textview text and open an activity when a press a button, but none of them works
View 1 RepliesI'm trying to make a widget to my app, but it doesnt update.I just need to change the textview text and open an activity when a press a button, but none of them works
View 1 RepliesIt was still working find few days back. Still get email notificantions every 15mins like how i set. But i just realized it dosent work anymore. Had to refresh it manually to get the new emails.
View 7 Replies View RelatedI'm having a problem with the clock/weather widget on my Hero. I have it set to Current City and I noticed the other day that the weather wasn't updating. ( I live in Long Beach, CA) It was stuck on one weather. I especially noticed when it still said partly sunny at 11pm. It doesn't work even if i try to manually update.
I thought it was just the current city function that was having trouble registering but when I go to other cities nearby it updates fine. And when I specifically set it to Long Beach, CA, it was still stuck and not updating.
Anyone else having this problem? Is there something wrong with the weather equipment in Long Beach?
Just got a new Android phone, my second after a brief stint with the G1 a year or so ago..
Today I noticed that I received notifications that I have apps with updates available. When I click on the notification it takes me to my downloads in the Marketplace, but it doesn't show me which app has an update. They all just say Installed.
Is there no way to tell what application needs updating?
I can create a static widget without thinking, I can even create a widget like the analogue clock widget that will update itself, however, I can not for the life of me figure out how to create a widget that reacts to when a user clicks on it. Here is the best code sample that the developer documentation gives to what a widget activity should contain (the only other hint being the API demos, which only creates a static widget):
public class ExampleAppWidgetProvider extends AppWidgetProvider {
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
final int N = appWidgetIds.length;
// Perform this loop procedure for each App Widget that belongs to this provider
for (int i=0; i<N; i++) {
int appWidgetId = appWidgetIds[i];
// Create an Intent to launch ExampleActivity
Intent intent = new Intent(context, ExampleActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
// Get the layout for the App Widget and attach an on-click listener to the button
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.appwidget_provider_layout);
views.setOnClickPendingIntent(R.id.button, pendingIntent);................
I'm trying to do my first widget but it seems not to work in the emulator: when I try to add the widget to the wallpaper, I've got the following message: "Application is not installed on your phone".
View 2 Replies View RelatedI've extended ViewGroup to achieve something like a FlowLayout.I put my custom ViewGroup into a ScrollView, dynamically add a bunch of content and it doesn't scroll.The content that flows off the screen is not viewable.What am I missing, how can I allow my ViewGroup to be compatible with ScrollView?
View 1 Replies View RelatedI want to make (yet another) news widget. Initially I thought it was enough to: 1. Download all the news articles 2. Update the widget every 5 seconds to change the currently displayed article using Alarm Manager (Alarm Manager.RTC) 3. Update the widget every 30-60 minutes to get new articles. This worked great on the first try but battery was quickly drained. I checked the logs and it turned out that the widget did the 5 second updates even if the screen was off. This was a surprise to me since the docs states: "..set an alarm with an Intent that your AppWidgetProvider receives, using the Alarm Manager. Set the alarm type to either ELAPSED_REAL TIME or RTC, which will only deliver the alarm when the device is awake. " I guess the device is considered "awake" even if screen is off? I found the same issue here: http://groups.google.com/group/android-developers/browse_thread/threa. I then checked the standard news widget and the other news widgets most popular on the Android Market and I see that they have services running all the time. Maybe because they want to handle the broadcast event when the screen is turned off? So is this really the best solution to have a service running in the background? So if someone downloads 10 different news widgets from different companies they end up with a list of 10 services in the "Running services" list?
View 6 Replies View RelatedAbout one-fourth of comments for my widget on the market are "Doesn't launch" with 1-star rating. Are you guys having the same problem? I've already included the instructions at the top of app's description but doesn't help. Here are the solutions I'm thinking about but don't know how to implement them yet.
1. Having a default activity showing a help page. But this would clutter the app tray with another useless app icon. Can I hide the app icon from launcher after first launch?
2. Launch widget picker activity from the market open button. But this doesn't tell users how to add widgets later on. Is it possible to set AndroidManifest.xml to open widget picker as default activity?
This questions somehow relates to the question when I was looking to get the extras back in startActivityForResult but now I face another challenge.
I have subscribed to receive ProximityAlerts and I have explicitly constructed the Intent to include some Extras. But when I got the service the extras are not there.
After the answers here is the working code:
CODE:..........................
The documentation says param PendingIntent to be sent for each location update.
I have an XML file in my layout folder that has how i want my custom widget/view (not sure what correct terminology is here).but how do i make it so that i can programatically, add one or more to an activity
View 2 Replies View RelatedSo this is the problem. Wifi works ok on my original 2.1 firmware. But it doesn't work on custom roms. Why is that? How can I fix it?
View 1 Replies View RelatedI'm developing a mobile website and I want to see how it looks in Android Simulator.
I manage to edit my android's /etc/hosts file. Here's what I did:
1. Create an Android Virtual Device (AVD)
2. Open the AVD with this command
Code:
./emulator -avd android -partition-size 128
3. Execute the following commands
Code:
./adb remount
4. Get the android hosts file
Code:
./adb pull /etc/hosts
5. Add my mobile website into the android's hosts file. It looks like the following
Code:
127.0.0.1 localhost
172.19.14.46 m.myweb.localhost
6. Push the hosts file to the simulator
Code:
./adb push hosts /etc/hosts
7. Open the web mobile in the simulator and Host do not found. The web mobile should appear.
Btw I use Ubuntu 10.10 and android-sdk_r08-linux_86 API 7 (Android SDK 2.1)
Can I use a custom view like com.examples.me.customview in the xml file of a app widget and can then draw in the onDraw of the custom view? Or do I have to draw into the drawing cache of an ImageView instead?
View 12 Replies View Relatedi made a extended a View, overwrote the 3 View Contructors and tried to insert it on my xml of a widget.is it possible to use custom views in Widgets?
View 1 Replies View RelatedI am writing a clock widget that uses customised bitmaps (so the widget loads the bitmap from the sdcard) Just have a couple of questions regarding how updates work:
1. if i want to display seconds on the clock widget will the widget load the bitmaps off the disk every second or can they be cached somehow so it doesn't reload off the disk each time. or If it does reload a bitmap each second, would this use a lot of power?
2. If i load the customised number bitmaps into a static array and then pass them as bitmaps to the widget would this use less power than just loading off the SD card?
I'm attempting to use a custom Android vertical scrollbar widget that seems to work fine in its own example project, but I am having trouble trying to include it into my project. I've exported a .jar from it to use in my project, but it seems to be a minefield of problems, from duplicate resources, to my XML layouts not able to get at styles inside the library, and errors "inflating class" when reading my XML layout file.How should I go about using the widget from another project in my own?Quite new to Java development (know the language, but not much of the overarching project/package management), so if there's some good text regarding that it would be appreciated.
View 2 Replies View Relateddata monitor widget missing after update to 2.1-xperia x8...any ideas?
View 1 Replies View RelatedI am using a custom ROM that apparently doesn't include a .pdf reader. Can anyone give me a quick source (link would be nice) to either the stock 2.1 pdf viewer, or point me to a good free one in the market? I'm leaving on a trip this afternoon, and will need to be able to read some .pdfs while away.
View 8 Replies View RelatedI'm writing an app that will host widgets. The app has custom view (which probably is the source of issue).mView.addWidget() basically just remembers this AppWidgetHostView instance and then mView draws it directly onto canvas. Visually everything is fine.I can see the actual widget. But the issue is with reacting on UI events. Please advise what needs to be done in the parent view in order to correctly trigger handlers in the widgets like onClick().I used standard widgets which normally react on click events. None worked.I also created my own test widget with listener and onClick()is successfully triggered if the widget is added on Homescreen, but doesn't work in my app.mView correctly detects click event and I tried to call widget.perform Click there, which returns false meaning onClickListener is not registered in the widget. But according to source .would call updateAppWidget which would register its onClick listener.
View 1 Replies View Relatedinstead of referring the custom widget by a fully qualified class name, is it possible to map with a shorter name. Like it happens in ant custom tasks (though properties file).
View 4 Replies View RelatedI am trying to add a button to a custom imageview. I have created a custom view to display an image to the screen, now i wanted to add a custom button on this veiw and display a layout in onClick. The following is my custom view.
View 3 Replies View RelatedI created a multiline textview widget which handles ellipsizing - is it appropriate to post it here in this forum for feedback, or is there an android site dedicated for custom widgets in the community?
View 4 Replies View RelatedI can add children just fine, but I'm never getting my custom onDraw() being called. dispatchDraw() gets called, but that seems to have a different canvas (the one that's within the padding. I need to draw on the whole layout area). Is there some flag that needs to get set to get onDraw() called for the layout?
View 1 Replies View RelatedI am developing a desktop widget.I would like to pop up a custom dialog when a remote view is clicked (much like the Facebook widget on Android when the user clicks in the update status field).I know how to use pending intents to launch an activity and have that currently hooked up.
View 2 Replies View RelatedI have read the LabelView example in APIDemo which show how to create a custom widget.However, what if I want to create a custom widget which is a composite of existing android widget?I know my custom widget need to be inherited from view, but if i do that, I can't do 'setContentView()' in my custom widget class (since that is an Activity method).so how can I apply the above xml to my custom widget class?
View 4 Replies View RelatedI would like to create a button with circular or rectangular background, text and an image below or above the text.I would like to create a CustomButton object with methods setText() and setImage() which would change the button text and image and place multiple CustomButtons into main layout.Does anyone know how to create a custom layout, place it into another layout(main) and modify its elements from the activity which is bound to main layout?
View 2 Replies View RelatedIn the ApiDemos, there is a view example called Gallery1 which declares a custom style in attrs.xml.I want to do the same thing for my widgets, but using a different namespace. However, as soon as I replace the android: namespace with something else,Unable to find attribute? Why does it look for an attribute I am about to declare? Isn't the point of this file to be able to name your own custom attributes?It's interesting to note that it works if you do not supply a custom namespace, but just an attribute name.
View 2 Replies View Relatedyou can see where he's defined a custom widget called ColorMixer.ColorMixer has an attribute named "initialColor" declared in attrs.xml.but getIdentifier never returns anything but zero.Is there something more I should be doing? I want to re-write this code to be completely independent of 'R'
View 1 Replies View RelatedThe native calendar widget doesn't display the current days events only the upcoming ones. Is there a way to change this or a different calendar app that is better?
View 18 Replies View Related