broadcastreceiver

Notification not getting removed on clicking action button even after providing the notification id

冷暖自知 提交于 2019-12-17 20:51:21
问题 I'm delivering a notification which has 2 action buttons namely "Accept" and "Reject". I'm following this Github repo. When user clicks "Accept", certain conditions are checked and the logic is performed accordingly. UPDATE 2.0 - The problem is that upon clicking "Accept" button, operation is happening successfully but the notification isn't disappearing from the status bar because the id generating here: m = (new Random()).nextInt(10000); is different from here: actionIntent.putExtra("id",

BOOT COMPLETE is not working in Android (Redmi)

牧云@^-^@ 提交于 2019-12-17 20:31:36
问题 I am currently working on a application which includes Boot_Completed Broadcast receiver concept. I have tested this app in my Motorola Moto G Phone. The app runs fine and shows the Toast message. But when I test this app in XIAOMI Redmi 1S phone it doesn't show the Toast message. I have already seen many questions similar to my issue (like these - Question 1, Question 2, etc.) ... But I haven't got any solution to this problem. My Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest

My BroadcastReceiver is not receiving the BOOT_COMPLETED intent after my N1 boots

 ̄綄美尐妖づ 提交于 2019-12-17 19:42:05
问题 I am unable to get my BroadcastReceiver onReceive method called using the BOOT_COMPLETED intent. AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.jerrellmardis.umbrella" android:versionCode="4" android:versionName="1.0.3"> <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar"> <activity android:name=".activities.Umbrella" android

Why does Intent.createChooser() need a BroadcastReceiver and how to implement?

折月煮酒 提交于 2019-12-17 19:34:21
问题 The following snippet, called from my implementation of onOptionsItemSelected() , works nicely to carry the user from my app to a mail client with email address, subject and body pre-filled. I'm using this as a simple way to let the user give me feedback. String uriText = "mailto:" + emailAddress + "?subject=" + subject + "&body=" + body; Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse(uriText)); startActivity(Intent.createChooser(emailIntent, "Pick an email app:")); When the

Boot Receiver not working

有些话、适合烂在心里 提交于 2019-12-17 18:42:21
问题 Manifest: <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".AlarmActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> <receiver android:name="CallReciver"> <intent-filter> <action android:name="android.intent.action.PHONE_STATE"> </action> </intent-filter> </receiver> <receiver android:name=".SmsReceiver"> <intent-filter android:priority="1000"> <action

Android DownloadManager get filename

主宰稳场 提交于 2019-12-17 18:17:14
问题 In my app you can download some files. I used the Android DownloadManager class for downloading. After the download is completed, it should show me a message that the file was downloaded. The problem is, there could be 2,3 or 4 downloads at the same time. My BroadcastReceiver code looks like this: receiver_complete = new BroadcastReceiver(){ @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equals(DownloadManager.ACTION_DOWNLOAD

Start IntentService from Activity and refresh Activity when IntentService is finished

与世无争的帅哥 提交于 2019-12-17 17:44:13
问题 In my Android application, I have a simple list view with adapter. There's a heavy query which is to fill the list view with data. So I put it to an IntentService that runs in another thread. The IntentService is normally running separately, on its own, just to query some data and insert it into the SQLite database. But now I would like to have the following possibility: The activity starts the IntentService with startService(). The IntentService does its heavy work. When the IntentService is

SMS Broadcast Receiver doesn't get the textmessage

随声附和 提交于 2019-12-17 16:49:28
问题 What I've done Hello Guys, I'm creating at the moment a SMS Broadcast Receiver, i just builded one up with this tutorial: Broadcasttutorial. After I did the code, I updated my Manifest. After that I sent sms from my other Phone to my Phone, but It didn't work. I didn't get any output. Question What do I need to change, that I can receive those SMS. Please gimme a detailed anwser that I can learn it, a good tutorial would also be great! Code SMSBroadcastReceiver (is in package .services)

GcmBroadcastReceiver IllegalStateException: Not allowed to start service Intent

青春壹個敷衍的年華 提交于 2019-12-17 16:39:10
问题 I am working on FCM Push notification in Android, where I am getting this exception: GcmBroadcastReceiver IllegalStateException: Not allowed to start service Intent I have searched many question in this forum, but still didn't got help for solving it. My Log and Manifest patch is also given below. Manifest: <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission

Priority in a broadcast receiver to receive calls

谁说胖子不能爱 提交于 2019-12-17 16:37:44
问题 My intention is to make a Broadcast receiver that performs actions when receiving a call. Is it possible that had more priority than the automatic call reception SO?. I've tried assigning a priority of 2147483647 which I think is the best, but still jumps me to try the call before the end of my receiver. <!-- Receiver de llamadas --> <receiver android:name=".PhoneCall"> <intent-filter android:priority="2147483647"> <action android:name="android.intent.action.PHONE_STATE"/> </intent-filter> <