android-pendingintent

Launch application after PackageInstaller finished (self) updating

Deadly 提交于 2020-08-10 13:42:13
问题 After the PackageInstaller successfully (self) updates the application, the application closes and doesn't launch again. Possible duplicate: Android PackageInstaller, re-open the app after it updates itself The situation is pretty similar, ill show some code snippets first. AndroidManifest.xml <receiver android:name=".UpdateReceiver" > <intent-filter> <action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> </intent-filter> </receiver> My PackageInstaller session runs in an

Launch application after PackageInstaller finished (self) updating

六眼飞鱼酱① 提交于 2020-08-10 13:40:05
问题 After the PackageInstaller successfully (self) updates the application, the application closes and doesn't launch again. Possible duplicate: Android PackageInstaller, re-open the app after it updates itself The situation is pretty similar, ill show some code snippets first. AndroidManifest.xml <receiver android:name=".UpdateReceiver" > <intent-filter> <action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> </intent-filter> </receiver> My PackageInstaller session runs in an

PendingIntent with implicit intent returning cancelled exception when using OpenId AppAuth-Android library

浪尽此生 提交于 2020-07-30 07:09:56
问题 I am trying to implement oauth2 to enable users to login with Reddit. I have created my app on reddit with the appropriate redirect uri. What I did: A MainActivity with a login button. Clicking the login button, starts the authorization flow. To create the authorization request, we need to pass a pending intent that the library uses to call the appropriate component that we want it to call after authorization is successful. Problem: When the pending intent is made using an implicit intent

Full screen intent not starting the activity but do show a notification on android 10

有些话、适合烂在心里 提交于 2020-04-10 03:21:18
问题 I try to launch activity for a broadcastReceiver by using the next code Intent i = new Intent(context, AlarmNotification.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { // This is at least android 10... NotificationManager mgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); if (mgr.getNotificationChannel(CHANNEL_WHATEVER)==null) { mgr.createNotificationChannel(new

Android does not reuse main activity and starts multiple instances ( behavior only after using PendingIntent )

余生长醉 提交于 2020-02-05 03:51:09
问题 I have an application with only one activity.In the onCreate I am showing a notification, on whose click I show my activity, reusing it if necessary ( or so I thought ) The code is: package com.example.multiplestartupifusingpendingintent; import android.app.Activity; import android.app.Notification; import android.app.Notification.Builder; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.Intent; import android.os

Android does not reuse main activity and starts multiple instances ( behavior only after using PendingIntent )

旧时模样 提交于 2020-02-05 03:51:04
问题 I have an application with only one activity.In the onCreate I am showing a notification, on whose click I show my activity, reusing it if necessary ( or so I thought ) The code is: package com.example.multiplestartupifusingpendingintent; import android.app.Activity; import android.app.Notification; import android.app.Notification.Builder; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.Intent; import android.os

Incorrect timestamp on future notifications

☆樱花仙子☆ 提交于 2020-02-03 05:26:10
问题 When my application is launched, it performs an API call and then schedules notifications based on the results. This amounts to around ~10 notifications being scheduled. There seems to be an issue with the timestamp displayed on the actual notification being incorrect. Since I am creating these notifications and then scheduling an alarm with an AlarmManager , the default time present on the notification will be the time at which the notification is created ( System.currentTimeMillis() ). I've

Can't start activity from BroadcastReceiver on android 10

陌路散爱 提交于 2020-01-25 08:53:10
问题 I updated my OS version to android 10 last night, and since then the startActivity function inside the broadcast receiver is doing nothing. This is how I try to start the activity based on the answer of CommonsWare: Intent i = new Intent(context, AlarmNotificationActivity.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { // This is at least android 10... Log.d("Debug", "This is android 10"); // Start the

How clear Android Notification PendingIntent

痴心易碎 提交于 2020-01-24 01:30:11
问题 I got a Activity which creates an alarm. The alarm calls a Broadcast Receiver. In on Receive i create a Notification with the extras from the Activity (ID, Title, Content). The Alarm triggers the Broadcast Receiver creates the notification well. But when i re install the application or install a newer version and setup a new Alarm with a new title and content the receiver shows me the first create notification intent. i can create may Alarm triggers all works but they show always the first

Tapping on a bundled notification doesn't trigger the PendingIntent

倖福魔咒の 提交于 2020-01-22 11:46:28
问题 So in Nougat multiple notifications from the same app get automatically bundled into a group. I'm setting a PendingIntent with some extras on my notifications and if a specific notification is tapped, it launches a specific activity (deep linking). However, if I tap on the notification bundle (i.e. without expanding the group) my app is simply launched as if it was from the launcher - i.e. its intent is empty, there are no extras (it is not launched via the provided PendingIntent). How can I