Questions tagged [receiver]

An object that receives some messages.

An object that receives some messages.

389 questions
49
votes
3 answers

Android - Bluetooth discovery doesn't find any device

I'm currently working on a little app to get started with the services that the Bluetooth Android API can provide. Edit -> Answer: It seems that the issue was due to the specific Nexus 5 devices. Seems like their bluetooth receiver doesn't work…
Amesys
  • 816
  • 2
  • 10
  • 19
29
votes
2 answers

WakefulBroadcastReceiver is deprecated

For creating a receiver I'm extended WakefulBroadcastReceiver in my old project. But now it's deprecated. Instead of WakefulBroadcastReceiver which Receiver I should use now and how to convert below code with new method? Here is my code: public…
Yeahia2508
  • 7,526
  • 14
  • 42
  • 71
27
votes
2 answers

Django: When to customize save vs using post-save signal

I have a series of tests and cases in a database. Whenever a test is obsoleted, it gets end dated, and any sub-cases of that test should also be end dated. I see two ways to accomplish this: 1) Modify the save function to end date sub-cases. 2)…
Nathan
  • 4,545
  • 6
  • 32
  • 49
27
votes
5 answers

Android DownloadManager get filename

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…
user1456060
19
votes
2 answers

android:enable and services

I m currently learning how create and use services on android. I looked on the android SDK for further help and i found the android:enable=[true | false]. in the SDK is said that: The and attributes must both be "true" (as…
Blood-HaZaRd
  • 2,049
  • 2
  • 20
  • 43
18
votes
3 answers

How to access type annotations on a receiver type's parameters

I am looking at a rather trivial class with a single method that defines an annotated receiver type: class Foo { void foo(Foo<@Bar T> this) {} } I would now like to access the type annotation on the receiver type's parameter @Bar but the Java…
Rafael Winterhalter
  • 42,759
  • 13
  • 108
  • 192
14
votes
2 answers

ResultReceiver.send can only be called from same library group

I have an IntentService that is using android.support.v4.os.ResultReceiver to pass data. In the IntentService, when I use ResultReceiver.send method to send the result back, Android Studio shows an error saying ResultReceiver.send can only be…
kp91
  • 1,168
  • 10
  • 14
12
votes
4 answers

Initialize pointer receiver in pointer method Go

How can I initialize a pointer receiver with a pointer method? package main import "fmt" type Person struct { name string age int } func (p *Person) Born() { if nil == p { p = new(Person) } } func main() { var…
Francis
  • 121
  • 1
  • 1
  • 4
10
votes
2 answers

ViewFlipper : Receiver not registered

In my app sometimes I receive this error : java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper$1@4806a4a8 at android.app.ActivityThread$PackageInfo.forgetReceiverDispatcher(ActivityThread.java:667) at…
Gabrielle
  • 4,933
  • 13
  • 62
  • 122
9
votes
2 answers

getting battery level at android widget

I wrote a widget for Android and I'm trying to get the battery level. I've tried using Intent batteryIntent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); but I get the error: "IntentReceiver components are not…
Ran
  • 4,117
  • 4
  • 44
  • 70
8
votes
3 answers

Fatal Exception: java.lang.IllegalArgumentException: Receiver not registered: android.hardware.camera2.CameraManager

I am developing a flashlight app that switch on/off the system tourch. I have a crash that shown on Android M (v6.0) on Crashlytics Here is the Issue details and stacktrace: Fatal Exception: java.lang.IllegalArgumentException: Receiver not…
8
votes
0 answers

Android Oreo - BroadcastReceiver + JobIntentService does not work properly (GCM notifications)

I have an app with GCM push notifications. Notifications are send from CMS. My appTargetSdkVersion=27. Everything works OK except two facts: app doesn't receive notifications when it is killed on devices with Android ver lower than Oreo. On Oreo I…
7
votes
4 answers

Is it better code practice to register a receiver in manifest or in code?

I'm writing a simple broadcast receiver. I've registered receivers in both the manifest and in the code before. For my purposes this is a simple receiver that doesn't need to do anything fancy. Is there a reason to choose one method over the other…
Dave
  • 3,178
  • 5
  • 28
  • 44
7
votes
0 answers

how to register a receiver for capturing completed download?

I was checking some tutorial on how to notify the receiver when the DownloadManager has completed the download, they register receiver pragmatically like this context.registerReceiver(onComplete, new…
Jolin
  • 1,515
  • 4
  • 21
  • 24
7
votes
2 answers

Calling registerReceiver from a DialogFragment

EDIT I added this line: getActivity().registerReceiver(new BroadcastReceiver(){...}, new IntentFilter(SENT)); There is now a runtime error though, the error reads: 09-03 04:12:41.856: E/AndroidRuntime(1692): java.lang.IllegalStateException: Could…
daniel_c05
  • 11,438
  • 17
  • 60
  • 78
1
2 3
25 26