android-pendingintent

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

那年仲夏 提交于 2019-12-22 11:25:24
问题 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

Does AlarmManager require the PendingIntent to be of Type BroadcastReceiver?

眉间皱痕 提交于 2019-12-22 09:24:21
问题 The documentation for AlarmManager seems to imply (but does not outright explicitly require) that the PendingIntent you pass in to any of the set() methods should be of the type BroadcastReceiver, but I tested passing in other component types (like an IntentService) and it seemed to work fine. Is it safe to use non-BroadcastReceiver Intents with AlarmManager? 回答1: Yes, and it has always worked, but I suspect not in the way that you're thinking. You can use any PendingIntent with an alarm;

How can I get the Intent extras for a PendingIntent that is already pending?

a 夏天 提交于 2019-12-22 05:54:09
问题 I have scheduled a PendingIntent with AlarmManager . When the AlarmManager delivers the Intent , I am able to getExtras() all the data that I originally sent. However, sometimes I get additional data that I want to pass with the Intent , before the AlarmManager fires. My thought was, I would just get the Intent like I was going to cancel it, but then after cancelling it, update the extras and reschedule it with the AlarmManager , like this: Intent i=new Intent(this, MyReceiver.class); Bundle

How can I get the Intent extras for a PendingIntent that is already pending?

随声附和 提交于 2019-12-22 05:54:03
问题 I have scheduled a PendingIntent with AlarmManager . When the AlarmManager delivers the Intent , I am able to getExtras() all the data that I originally sent. However, sometimes I get additional data that I want to pass with the Intent , before the AlarmManager fires. My thought was, I would just get the Intent like I was going to cancel it, but then after cancelling it, update the extras and reschedule it with the AlarmManager , like this: Intent i=new Intent(this, MyReceiver.class); Bundle

AlarmManager object after turning off and on the phone

此生再无相见时 提交于 2019-12-22 05:25:15
问题 In my app, I set an alarm AlarmManager alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); ... PendingIntent pendingIntent = PendingIntent.getBroadcast(context, id, intent, PendingIntent.FLAG_UPDATE_CURRENT); ... alarmMgr.set(AlarmManager.RTC_WAKEUP, time.getTimeInMillis(), pendingIntent); It works fine unless I turn off and turn on the phone. To be more specific, let's say at 10:20, I set an alarm to 10:22 and I turn off and turn on the phone at 10:21, alarm won't work.

Can you use pending intents with localbroadcasts?

╄→гoц情女王★ 提交于 2019-12-21 07:28:49
问题 I am interested in using pending intents with local broadcasts. To make myself clear, I am using the following for registering receivers and sending broadcast: android.support.v4.content.LocalBroadcastManager . I have a local broadcast receiver in a service which works. I am trying to send local broadcasts from a custom notification layout which includes click-able items. The local broadcast receiver - just receives simple action intents. I was trying something like this to no avail: Intent

When is advised PendingIntent vs. LocationListener on requestLocationUpdates?

谁都会走 提交于 2019-12-21 05:23:13
问题 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? 回答1: If the component needing location updates only needs updates when the component is around -- say, an activity -- I'd use the LocationListener approach. If the component needing location updates specifically will not be around -- say, an IntentService -- I'd use the PendingIntent . You can't use the LocationListener

How to identify which SMS has got Delivery report in Android

纵然是瞬间 提交于 2019-12-21 05:17:08
问题 My application retrieves records from sqlite database and SMS to other application by merging the records based on the size of the record, i am intruble to identify which messages have got the delivery report and which does'not . i am using BroadcastReceiver on reciveMethods but unfortunately i can't understand how to identify . i would love if any one of you suggest me the how to handle this problem. or any other better way public class MessageMangerActivity extends Activity { private String

Opening a PDF file using FileProvider uri opens a blank screen

倾然丶 夕夏残阳落幕 提交于 2019-12-21 04:07:06
问题 I'm creating a PDF file on my app and writing it to the external storage, "Download" directory. Now, when I open it through my app with an intent action.VIEW using FileProvider uri, Google PDF Viewer displays a blank screen, Adobe Acrobat cannot even open the file. Here's my code to write the file and then trying to show it. Note that I'm sending a local notification and trying to open the file through the notification. try { File mypath=new File( Environment.getExternalStoragePublicDirectory

Android - DeleteIntent, how to use?

百般思念 提交于 2019-12-20 05:01:20
问题 I currently have a notification in my Android application that has a PendingIntent so that when it is clicked an activity is opened. I currently keep a counter for the notification, similar to the native missed calls notification. I can reset this counter to 0 when the notification is clicked. I also want to reset the counter to 0 when the user selects the "Clear all notifications" button. I have done a search and seen the way to do this is to use the DeleteIntent. But I cant figure out how