Android :: Widget : Get Data From Configure Activity To AppWidgetProvider?

Feb 14, 2010

I'm writing a widget where i first have a configure screen where the user makes a selection. Then I want to pass that data on to the actual widget. This must be really simple but I just can find out how to do it.

Android :: Widget : Get data from configure Activity to AppWidgetProvider?


Android :: App Widget Configure Activity Opens Main Activity

Jan 10, 2010

I hav an app that is like a relational database. There is a main app activity that users manage things with. There is also a widget that will display important info and add data to the database. When the widget is clicked, a configure class displays a way for the user to edit data. When the configure activity is done, the widget is updated and instead of going back to the home screen, the apps main activity is started. I can't find where the main activity is being called from. Wouldn't I have to create an intent and start Activity() to get this behavior? When done updating, I want the home screen and not my app.

View 3 Replies View Related

Android :: How To Decide Widget Size In Configure Activity?

Feb 7, 2010

in HTC Sense, we can choose widgets of different size after tapping a single entry in the widget list. Is this also possible in pure Android Framework? I have tried to modify the widget's size in the configure Activity, but failed.

View 2 Replies View Related

Android :: TabActivity Crash When Create Tabbed View In Widget Configure Activity

Dec 4, 2009

I'm trying to create a tabbed view in my widget configure activity. I'm using a tab activity as my activity type and I have the following code..................

View 2 Replies View Related

Android :: Add App Widget Through Created AppWidgetProvider?

Jul 14, 2010

I'm slighty puzzled about how android's AppWidget machinery works. I reimplemented the AppWidgetProvider's constructor like this:

public class MyProvider extends AppWidgetProvider {
public MyProvider() {
Log.d("TEST", "Creating...")
}
public void onUpdate(..., int[] appWidgetIds) {
// updating stuff here

From what I've read in the docs, I understood that AppWidgetProvider is instantiated once, when widget of that type is added for the first time. If another widget of the same type gets added, it will be managed by exactly that provider.But I just discovered that this is not the case. For each widget I add, android creates a new MyProvider (I see that from 'adb logcat' - it prints "Creating..." for each widget)!I don't understad why. Maybe I got something wrong? Or documentation isn't clear on something. What's the reason of having appWidgetIds passed to onUpdate and other methods if each provider is managing only ONE widget?

View 2 Replies View Related

Android :: Accessing Elements Of Widget From AppWidgetProvider

Nov 23, 2009

I have built a widget that contains a button and an editable TextView (that behaves like an EditText) much like the native Google Search bar widget. How can I access the text that the user has typed into the TextView? In an Activity I would just use findViewById(), but of course I can't do that in the AppWidgetProvider. (I get the error message "The method findViewById(int) is undefined for the type Widget.") So I tried to solve it by using a million casts, like so: String str = (String) ((TextView)((Activity) context).findViewById(R.id.txt_input)).getText(); Unfortunately, with that line present my app crashes. What is the correct way to get references to those Widget elements? I've read all about RemoteViews and Widgets and looked for examples where somebody does this (which seems like it would be common, but I guess not) but I haven't turned up a solution. What am I missing?.....

View 8 Replies View Related

Android :: Way To Display A ListView On A Home Widget With AppWidgetProvider?

Jun 5, 2010

I would like to create a Home Widget containing a ListView, but I don't know if this is possible and if it is, how to do it. I was using a ListActivity and it was pretty simple, but can't figure out a way to do it using AppWidgetProvider.

View 1 Replies View Related

AsyncTask Put In Widget (AppWidgetProvider)?

Apr 5, 2013

I read from my web space from a text file and paste it in TextView.Everything works.

But now I want the (AppWidgetProvider) in my widget insert. My widget has a TextView.

So how can I connect a AsyncTask with a AppWidgetProvider?Tried it. But the app crashes from then.

My MainActivityl.class with AsyncTask it reads. And my AppProviderWidget.class

View 4 Replies View Related

Android :: AppWidgetProvider Not Inform When Adding Widget Fails Due To Not Enough Space

Dec 30, 2009

My app has a 1*4 icon size widget. When a user tries to add a widget I provide with a configuration screen. and some data is collected - it is verified by the server - it is added to the local DB with appWidgetID as the key - all is good. when user hits save, if there is not enough space, he is given a polite toast - "No more room on this home screen". Now my problem is that the application is not informed of this. Application still assumes the widget was created and sits back and wait for the broadcast to update the widget after certain amount of time.

Can anyone tell me if i can find out via a broadcast or a call back or any method possible to determine if the widget was not successfully created, so that i can mark that record in my DB as deleted. Or better if i can know the space available beforehand via some magic ninja code. my whole application design is disturbed because of this problem.

View 3 Replies View Related

Android :: Data Of Previous Activity Gone When New Activity Starts

Dec 30, 2009

I am developing an application in which the user require to register first and than got the user page. For that i have made layout and the layout consist many fields, so, i have made part of layout and also made the separate activity for the each layout. The layout like address, phone, etc... After that i have wrote the code for calling an activity and it works fine. It means when i press the "Next" button the another page will come and it will also consist some textview ,edittext and previous and next button. Actually, i want something different like -- When the user fill the first form and he will proceed to next, the content written by the user should not gone when the user press "Next" button. The content should be there which was written by user. And same way i have have 6 pages like that way to complete the registration process. So, have you any idea to solve above problem? I really need your help because right now i stuck at this point. So, please any body help me out of this problem. I would appreciate your help. I am waiting for your reply.

View 15 Replies View Related

Sony Ericsson Xperia X10 :: Used Data Toggle Widget Data Is Blocked After Uninstall?

Nov 22, 2010

I had been using the DATA TOGGLE widget for couple days, today strangely the widget was not functioning, it was not possible to turn on/off data. I tried uninstalling the app but still the problem persists.I tried switching off the phone, remove battery didn't work also tried the airplane mode on/off without luck also tried changing the ENABLE DATA in the settings no luck Cleare all current APN's and re installed the APN settings but still the problem persists?

View 3 Replies View Related

Android :: AppWidgetProvider - 1.5 SDK?

Apr 21, 2009

I have a general question. Is it possible to set the RemoteView of the widget to a WebView? My goal is to push real time updates to the WebView via the comet technique (HTTP long polling), similar to how Google Talk does it on the desktop browser I suppose. Do you think battery life would be significantly impacted with this approach?

View 5 Replies View Related

Android :: AppWidgetProvider And BroadcastReceiver

Oct 2, 2009

I have an app widget that extends an AppWidgetProvider to create an application widget.

I would like the application widget to be idle until an activity in my app runs; actually when a service in my app is started.

Once that service is started, I need to "wake up" the application widget and communicate with it (i.e. tell it things to display).

So I see that AppWidgetProvider simply extends BroadcastReceiver -- so does that mean:

1. I need to call registerReceiver in my service and tell it to filter for certain kinds of events?

2. Can I even do #1, or will an AppWidgetProvider *only* accept ACTION_APPWIDGET_* intents?

3. If #2 is correct, how can I communicate or "wake up" / trigger the application widget?

4. Can I send events to my app widget using sendBroadcast( intent )?

Then, my app widget has some buttons on it, I need to send an intent back to the application (or service). I see you can do that with PendingIntents, but if i send the different intents it to the same Activity, it seems to re-use the first created pending intent.

View 2 Replies View Related

Android :: Pass Value From AppWidgetProvider?

Nov 8, 2010

I would like to pass a value from the AppWidgetProvider to a service. How can I do that? This value is taken from the widget configuration. If this value changes (by going to the configuration again), how do I pass it back to the service? Is there another way to do this?

View 1 Replies View Related

Android :: Model For AppWidgetProvider

Aug 2, 2010

I have a widget that shows some data fetched from the Internet. I may have multiple widgets visible on the screen, each displaying some data, partly the same as the other widgets. From time to time I re-fetch the data from the Internet and update the widget views. I've modeled this in an MVC style: I have a model which I can invoke a "re-fetch-data" on, and which the views listen on. My questions:

A) Is it wise to let my model be a singleton?
B) Can I rely on that all widgets are served by the same AppWidgetProvider? Or may some of my widgets get served by a different AppWidgetProvider instance? Or, more generally: Is there any guarantee that there will be only one instance of my AppWidgetProvider? If there is only one instance of my AppWidgetProvider, then I could use an instance variable here for the model, and pass either my AppWidgetProvider or the model around where needed. Perhaps a better option?

C) In the AppWidgetProviders onUpdate method, can I be sure that the same "context" object is passed as argument each invocation?

View 1 Replies View Related

Android :: Updating AppWidgetProvider From Service

Jan 1, 2010

Here is my issue, I want to be able to update a specific AppWidgetProvider (home screen widget) from a custom service class. I have to build the remote view in the service because I'm also doing some networking in there, which takes some time. The problem is that I can't figure out how to update a specific widget (individual widgets can have different update intervals, using the alarm manager). If I wanted to do it from the onUpdate of the AppWidgetProvider I could just call appWidgetManager.updateAppWidget(appWidgetId, remoteView); Does anyone have any experience with this or any suggestions?

View 4 Replies View Related

Android :: AppWidgetProvider And Screen Updating?

Nov 13, 2010

I am making a clock widget for the android home screen using AppWidgetProvider. I have it calling the TImerTask class that updates all my values using this code:

@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds {
Timer timer = new Timer();
timer.scheduleAtFixedRate(new MyTime(context, appWidgetManager), 1, 1000);
}

In the TimerTasks run() I am setting a bunch of text views to the relevant values. My problem is that this seems to work fine, but it makes my home screen unresponsive, probably due to updating it every second. How do I fix this and still have it update the display at the correct time? (I only need to see minutes not seconds, but I want the minutes to change at the correct second.)

View 2 Replies View Related

Android :: AppWidgetProvider - Convenience Functions

Oct 30, 2009

It seems like the convenience functions (onUpdate, onEnabled, etc.) aren't being called in the emulator on Android 2.0. Is this a bug, or are these functions just being eliminated? It would have been nice to see this documented somewhere.

View 4 Replies View Related

Android :: Start AlertDialog From AppWidgetProvider

Aug 6, 2010

Anyone know if it is possible to add AlertDialog within a AppWidgetProvider class? Here is the code I am working on where I start the AlertDialog on onEnabled function call.

@Override public void onEnabled(Context context) { super.onEnabled(context); Log.v(TAG,"onEnabledWidget"); AlertDialog.Builder builder = new AlertDialog.Builder(context).setIcon( android.R.drawable.ic_dialog_info ).setTitle(R.string.app_name) .setMessage("This is testing") .setNeutralButton("Confirm", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); alertNotSmc = builder.create(); alertNotSmc.show(); //runs when all of the first instance of the widget are placed //on the home screen .........

View 5 Replies View Related

Android :: Sending Event / Intent To AppWidgetProvider

Sep 30, 2009

From a service that's running, how do I send an event or an intent to an app widget that is just sitting their idle.

View 6 Replies View Related

Android :: Signal An AppWidgetProvider From Service Running In Another Process

Feb 2, 2010

I am attempting to signal my widget such that it receives my new Intent from my service

The code I am using to send from the service is as follows:

CODE:...........................

View 2 Replies View Related

Android :: ProgressBar Doesn't Allow Control Of Visibility In AppWidgetProvider

Aug 7, 2009

I was trying to set a progress bar to View.INVISIBLE or View.GONE, or View.VISIBLE inside an AppWidgetProvider. However, it doesn't seem to want to do it. Setting visibility works fine with TextView fields or ImageView fields or ImageButtons. However, ProgressBar doesn't seem to work. It doesn't make sense that just the progress bar type isn't supported for controlling visibility. Has anyone else seen this problem?

View 4 Replies View Related

Android :: Can ListActivity / Tab Widget Be Use In One Activity?

Aug 9, 2009

My activity have to use List and Tab widget, one is left side,the other is right side, I means layout, but use List must to extends ListActivity, and use Tab widget must to extends TabActivity?

View 7 Replies View Related

Android :: Call Activity From Widget?

May 30, 2009

I've read through the Application Fundamentals three times today (and I had done so before), but I still can't quite wrap my ahead around the task concept. Or I guess I thought I understood it, but usually, the results I am seeing don't match up to what I would expect to happen (maybe a tool to see the current tasks/activities etc. for debugging purposes would be a nice addition).

I have multiple widgets from my provider in the Launcher desktop, and each is using a PendingIntent with a different URI as data (so they should be separate intents) to open an Activity.

I want there to be only once concurrent instance of this Activity that the user can access. So clicking the widget (1) , pressing HOME (2), clicking a different widget (3), pressing BACK (4) should bring the user back to the Desktop.

Now I did manage to do this using launchMode="singleTask" - the existing instance is brought to the top, onNewIntent() is called and I am pretty satisfied with it.

However, supposedly there are other ways to achieve an equivalent effect (say with having the activity restarted), and I'd like to understand why I don't seem to be able to get them to work: In every case, instead of seeing the home screen after step (4) (after pressing BACK), I see the *previous* instance of the Activity.

For example, if I read this correctly:

"There's another way to force activities to be removed from the stack. If an Intent object includes the FLAG_ACTIVITY_CLEAR_TOP flag, and the target task already has an instance of the type of activity that should handle the intent in its stack, all activities above that instance are cleared away so that it stands at the top of the stack and can respond to the intent. If the launch mode of the designated activity is "standard", it too will be removed from the stack, and a new instance will be launched to handle the incoming intent." http://developer.android.com/guide/topics/fundamentals.html

Then simply using using the following code to start my Activity from my widget should do what I want, no?

CODE:............

So in (3) My activity should be launched using FLAG_ACTIVITY_NEW_TASK by the launcher, which due to process affinity would find the existing task (which would consist of a single instance of my Activity), and launch the new instance on top of it. This explains what I am seeing. Why doesn't FLAG_ACTIVITY_CLEAR_TOP cause the existing instance in the task to be replaced?

Even setting android:launchMode explicitely to "standard", as mentioned in the doc quote above, this doesn't seem to change things.

I also tried android:finishOnTaskLaunch="true", but the behaviour is the exact same was just described with FLAG_ACTIVITY_CLEAR_TOP (which seems to be the exact same as when doing neither and really starting an activity without any special attributes).

I should mention that If I click the same widget in (3) as I clicked in (1), i.e. using the same PendingIntent twice, I do get the previous instance brought to the front (not restarted), but again, regardless of whether FLAG_ACTIVITY_CLEAR_TOP or finishOnTaskLaunch are being used.

I find this especially strange since the docs about tasks don't seem to mention the intent itself being relevant at all. Application Fundamentals does at one point say "For the default "standard" mode, a new instance is created to respond to every new intent", but it's not clear what "new intent" means then. Is triggering a PendingIntent multiple times through a widget not multiple "new" intents then?

I also tried various combinations of the other related options, but pretty much got nowhere.

View 2 Replies View Related

Android :: Update A Widget From An Activity?

Sep 22, 2009

I have been looking for a way to update a widget asynchronously, for example, when the phone receives a text message. I have a broadcast receiver set up with code that runs upon receiving a message. I also have an AppWidgetProvider that is set up and running. It seems like the *only* way a widget can be updated is upon its interval, or when the user interacts with it. Is there any way to update a widget upon a system event?

View 6 Replies View Related

Android :: Update Widget From Activity

Nov 1, 2010

I have a widget, its setup so that when I click on it, it opens some settings in an activity.

CODE:................

This configures some settings for the application. What I want to achieve is to have the widget update its view to reflect the changed settings when the Activity I launch closes. Using the update interval or any other type of polling isn't appropriate for this.

I've seen a couple places here and in the android docs this code used:

CODE:...................

But I don't know how to get the mAppWidgetId value. I tried following the example for a widget configuration activity here http://developer.android.com/guide/topics/appwidgets/index.html, but in the following code,

CODE:............

Extras is always null, so I never get the AppWidgetID.

View 1 Replies View Related

Android :: Widget - Update From My Activity?

Nov 8, 2010

I have added a widget and instead of updating it every xxx minutes, i want to update it only if in my activity something is changed. But how can i call the onUpdate Routine of my widget from my activity?

View 3 Replies View Related

Android :: Embed An App Widget In An Activity?

Mar 19, 2010

I want to embed the analog clock in my application.

I use <AnalogClock android:layout_width="wrap_content" :layout_height="wrap_content" /> in my layout XML file, but the clock's appearance is different from the one added in Home screen. I know I can copy the AlarmClock's images to my project. And in xml file, set the android:dial, android:hand_hour,and android:hand_minute to my project's images. But I want to know is there a way to directly reference the resource in the AnalogClock?

second question, Can I add the app widget from code? I tried use following code to add a appwidget, but it seems the getAppWidgetIds don't work?

CODE:...................

View 3 Replies View Related

Android :: Run A Prefs Activity From My Widget

Mar 11, 2010

I've made an application for network monitoring "Myapp" under com.domain.monitor package and which contains a Prefs-activity . After that , I made a widget to let the admin keep an eye on hosts status "the information is presented as a graph in the widget" , also the widget has it's own package different of the Myapp's one & has a unique Prefs button ! (complicated Crying or Very sad , I know)

The Problem : Is there any way To run Myapp and show the prefs- acitvity by clicking on the widget's buttton !

View 3 Replies View Related

Android :: Store State Information In AppWidgetProvider - Between OnUpdate Cycles

Aug 26, 2009

I know I can save information in a static attribute in a widget, however, is there a way for a widget instance to save the state information similar to the Activity onSaveInstanceState(Bundle outState) method? I don't want to write to a database for this state information.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved