Is it ok to drop PendingIntents in android if they are never used. Such as in an AppWidgetProvider where a PendingIntent that was never used be overwritten by a new PendingIntent.
Or should we call cancel on all unused PendingIntents to clean up memory appropriately?
...
I have a widget that supposed to call an Activity of the main app when the user clicks on widget body. My setup works for a single widget instance but for a second instance of the same widget the PendingIntent gets reused and as result the vital information that I'm sending as extra gets overwritten for the 1st instance. So I figured tha...
Hi,
I've developed an Application (called Instant Buttons) and the app has a widget feature. This widget uses PendingIntent for the onClick of the widget.
My PendingIntent code is something like this:
Intent active = new Intent(context, InstantWidget.class);
active.setAction(String.valueOf(appWidgetId));
active.putExtra("b...
Hi,
I've asked here a question about Task Killers and widgets stop working (SO Question) but now, I have reports of user that they don't use any Task Killer and the widgets didn't work after a while. I have a Nexus One and I don't have this problem.
I don't know if this is a problem of memory or something. Based on the API:
A Pendi...
Solved while writing this question, but posting in case it helps anyone:
I'm setting multiple alarms like this, with different values of id:
AlarmManager alarms = (AlarmManager)context.getSystemService(
Context.ALARM_SERVICE);
Intent i = new Intent(MyReceiver.ACTION_ALARM); // "com.example.ALARM"
i.putExtra(MyReceiver.EXTRA_ID...
you can subscribe to requestLocationUpdates via two ways
one by specifing a PendingIntent
the other is by using a LocationListener
When is advised the one and when the other?
...
protected void displayNotification(String response) {
Intent intent = new Intent(context, testActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, Intent.FLAG_ACTIVITY_NEW_TASK);
Notification notification = new Notification(R.drawable.icon, "Upload Started", System.currentTimeMillis(...
I've read many posts on the same topic and tried all the given solutions without getting the result I want.
The program should start an intent with extras from a notification:
NotificationManager mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
Intent notificationIntent = new Intent(...
In my program I have a dialogue-themed activity that pops up with an edittext and submit button that sends an sms message.
After the message is sent I want the phone to go back to whatever activity it was doing before (the dialogue is started by a broadcast receiver)
however SMSManager's sendTextMessage(...) method takes a pending inte...
I am following sample code for sending an update notification every 10'seconds. The code follows and it is in an "UpdateService" for an AppWidgetProvider. If I put a Thread.sleep(10*1000); I can see the expected behavior of my servicing loop. I obviously have something fundamentally wrong that is triggering immediately. It is suppose...
I want to build a search widget. Clicking on the widget should open search activity inside my app. Here is the code from widget provider's onUpdate().
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)
{
/* as their may be many widget instances for this widget. we get an array. */
for(i...
I have a widget class and a service class updating the widget.
I have added in the widget class in onUpdate() the following code:
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.countdownwidget);
Intent Intent1 = new Intent(Intent.ACTION_MAIN);
Intent1.addCategory(Intent.CATEGORY_LAUNCHER);
PendingIntent ...
Hi all,
I'm using an AlarmManager to trigger an intent that broadcasts a signal. The following is my code:
AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(this, Wakeup.class);
try
{
PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, 0);
Long elapse...
I try to write my first widget application and i got a problem. So, i have 2 arrows: switch to left and switch to right. For both of them I want to use a single Service, which changes the view of my homescreen widget according direction of arrow. For distinguish the direction of arrow i put an extra data to each intent i use. This is my ...