android-pendingintent

Android: Clicking Grouped Notifications Restarts App

耗尽温柔 提交于 2019-12-07 03:27:22
问题 I am trying to solve an issue that I am experiencing with notifications. In my app, I am creating a notification (with an indeterminate progress and a randomly generated integer code) when someone clicks a list item to download a file. On the callback of the download, I update the notification to stop the progress, using the same id of the original notification. Clicking a notification is supposed to open the downloads folder on the phone (using a pending intent). All is well at this point.

Send broadcast on notification click

拈花ヽ惹草 提交于 2019-12-07 02:15:28
问题 I have an application which is basically a webview and GCM notifications. I want to achieve the following thing: If the user is in the app and receives a notification, when he clicks the notification I want the webview to load the url provided in the notification. I'm trying to accomplish this by using broadcast receiver but it doesn't work. I dynamically register the receiver in the MainActivity: private void registerNotificationReceiver() { final IntentFilter filter = new IntentFilter();

Pending intent with ONE_SHOT flag

半世苍凉 提交于 2019-12-07 01:30:54
问题 Currently I've got this code: public static void setupAlarm(Context context) { Intent myIntent = new Intent(context, Receiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, myIntent, PendingIntent.FLAG_NO_CREATE); if (pendingIntent != null) { return; } else { pendingIntent = PendingIntent.getBroadcast(context, PENDING_INTENT_RETRY, myIntent, PendingIntent.FLAG_ONE_SHOT); } AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);

What happens to the alarms set via alarm manager by an app, if the app is uninstalled

你离开我真会死。 提交于 2019-12-07 00:04:36
问题 I have the below code to set up an alarm from my app. Intent intent = new Intent("MY_ALARM_NOTIFICATION"); intent.setClass(myActivity.this, OnAlarmReceive.class); intent.putExtra("id", id); PendingIntent pendingIntent = PendingIntent.getBroadcast( myActivity.this, Integer.parseInt(id), intent, PendingIntent.FLAG_UPDATE_CURRENT); Calendar timeCal = Calendar.getInstance(); timeCal.set(Calendar.HOUR_OF_DAY, hour); timeCal.set(Calendar.MINUTE, minutes); timeCal.set(Calendar.DAY_OF_MONTH, day);

Google location API: request location updates with pending intent?

时光毁灭记忆、已成空白 提交于 2019-12-06 22:49:54
问题 I have started to implement the Google Location API using this tutorial. I've managed to get it to work in my application quite fine, it updates my location at the right intervals etc. Now I am working on how to update my location when the device is in sleep mode. According to the documentation, this method is the way to go: public void requestLocationUpdates (LocationRequest request, PendingIntent callbackIntent); My question is, how do I set up this PendingIntent, and how do I handle it? I

PendingIntent to launch and stop a Service

谁都会走 提交于 2019-12-06 21:41:19
问题 I'm trying to make a simple widget with a button that start a Service with the OnClickPendingIntent() . I can start it fine but I can't figure out a way to stop it (I know I can do it with a BroadcastReceiver or something similar but I would like to avoid hardcode). This is my code: Intent intent = new Intent(context, myService.class); PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0); RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.my_widget

Didn't include a pendingIntent in the extras?

狂风中的少年 提交于 2019-12-06 17:05:58
问题 I came across this Error message on Logcat while working on an app. Can anyone tell me what it means? 07-24 23:34:20.288 1140-1140/? E/NetworkScheduler.SchedulerReceiver﹕ Invalid parameter app 07-24 23:34:20.288 1140-1140/? E/NetworkScheduler.SchedulerReceiver﹕ Invalid package name : Perhaps you didn't include a PendingIntent in the extras For your information: I used an AlarmManager in this app 回答1: It is probably means that you are missing a uses-library deceleration inside the

Android GCM multiple push notifications with one icon in status bar

試著忘記壹切 提交于 2019-12-06 16:39:58
My app wants to bundle multiple push notifications in one icon in the status bar. When clicking on the icon, the multiple notifications should be received by the app to show them in listview mode. There are already some entries in stackoverflow which come close to what I want to obtain and it did give me a better insight in handling pending intents and notification flags but they didn´t solve completely my problem. First step: Creating the notification: Following some entries in stackoverflow, I made the following assumptions: One notification ID (notifyID) to obtain only one icon in status

Android pending intent not being called within widget

萝らか妹 提交于 2019-12-06 14:59:36
问题 Like in this question (accepted answer), I'm trying to launch voice recognition from one of my app's widgets. I succesfully managed to open dialog that requests voice input with this code inside onUpdate() method of the Widget: // this intent points to activity that should handle results, doesn't work Intent activityIntent = new Intent(SoulissApp.getAppContext(), WrapperActivity.class ); //doesn't work as well //activityIntent.setComponent(new ComponentName("it.angelic.soulissclient", "it

Geofence Android isn't working (IntentService isn't called)

╄→尐↘猪︶ㄣ 提交于 2019-12-06 12:30:47
Here are my code : Android Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="pounya.id.location3"> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <service android:name=