Questions tagged [receiver]

An object that receives some messages.

An object that receives some messages.

389 questions
6
votes
3 answers

"Lambda with Receiver": What is this Kotlin construct?

I'm looking at this Kotlin object declaration: object A : B({ variableName1 = "text1" variableName2 = "text2" params { param("Foo", "Bar") } }) And I cannot figure out what the argument to class B's constructor is. I have…
ZoSal
  • 561
  • 4
  • 21
6
votes
2 answers

Run service on incoming SMS in android Oreo

I'm developing an app which needs to run some code (Networking) whenever an SMS is received. In API 25 and lower it's fine, I register an implicit receiver in Manifest file and start my service in the specified class which extended…
6
votes
2 answers

Django 1.8 - Signals - What's the difference between @receiver decorator and Signal.connect() method?

They appear to do the same thing. Is there a difference in functionality, usage, etc? In what circumstances should one be used over the other? Thanks
StringsOnFire
  • 2,726
  • 5
  • 28
  • 50
5
votes
1 answer

Within a Django Model, how can I prevent a delete based on a particular field?

In the following, I have a Post model. A Post object has a status field that can be 'unpublished' or 'published'. if status is 'published', I'd like to prevent the object from being deleted, and would like to keep this logic encapsulated in the…
StringsOnFire
  • 2,726
  • 5
  • 28
  • 50
5
votes
2 answers

Casting Serilizable to derivation of HashMap

I am trying to send some work from IntentService to BroadcastReceiver by using .putExtra() and sendBroadcast(), so I have own class called "Message", which extends HashMap< String,String> and implements Serializable. public class Message extends…
user704565
5
votes
2 answers

Android: How to create a receiver that listen any changes of system settings?

I'm trying to create a BroadCast receiver that listen any changes of system settings to update a UI. I wrote a series of action in intent-filter on my android manifest in this way:
Meroelyth
  • 5,310
  • 9
  • 42
  • 52
4
votes
1 answer

BOOT_COMPLETED not called on Honeycomb after export

I have a very weird problem, and none of the questions already on the website have an answer or the same problem. I have an app that receives BOOT_COMPLETED. I made sure it could receive the intent by setting…
Setsuki
  • 255
  • 2
  • 11
4
votes
1 answer

Sending SMS using Intent does not add recipients on some devices

I send SMS using code below: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("smsto:" + phoneNumber)); intent.putExtra("address", phoneNumber); intent.putExtra("sms_body", messageBody); …
Kostas
  • 2,434
  • 3
  • 19
  • 18
4
votes
1 answer

Can I add multiple receivers to my Manifest?

Ok so I am making a set of widgets that will simply open up a specific app when pressed. I am fairly new at developing, so my question is if I can just keep adding a new receiver to the Manifest for each individual widget? I tried it and it was…
natehoch96
  • 69
  • 4
  • 8
4
votes
1 answer

Android In App Billing: Receiver's onReceive never getting called even after a successful purchase

I'm not sure what code to put here but I have a working in-app purchase setup in my app (in the sense that the correct amount and item is billed to my account) but the problem is the changes never show up on the user's end, when they buy an item the…
Sam Stern
  • 24,624
  • 13
  • 93
  • 124
4
votes
1 answer

Kotlin extension function of a function with receiver

I'm playing with Kotlin's extension functions. I'd like to create an extension function for boolean-returning function with receivers which returns the complement function. My goal is to be able to write: val isEven: Int.() -> Boolean = { this % 2…
4
votes
1 answer

Cannot have more than one INSTALL_REFFERER receiver in Android Manifest

I am using the AdMob install receiver in my Android Manifest file, e.g.
user605333
  • 303
  • 1
  • 4
  • 9
4
votes
2 answers

C++ DGRAM socket get the RECEIVER address

In C++, how can I get the receiver address of the UDP packet which I have received using recvfrom. I know that it should be the same host on which I am receiving the packet, but I need to extract it from the received packet, in order to verify…
SkypeMeSM
  • 3,197
  • 8
  • 43
  • 61
4
votes
1 answer

BroadcastReceiver for Ethernet(RJ45) and USB in Android TV

How can i detect the plug and unplug of Ethernet cable and USB devices(Any device like pendrive) in Android TV. Is there any receiver for that as like internet connectivity? I need to check for by TVBox app. Solution: Got Solution for ETHERNET -…
Arth Tilva
  • 2,496
  • 22
  • 40
4
votes
2 answers

Getting the owner of a constant

With a(n inherited) method, the receiver/class where it is defined can be achieved by doing: class A def foo; end end class B < A end B.instance_method(:foo).owner # => A With a(n inherited) constant, there is no counterpart to instance_method…
sawa
  • 165,429
  • 45
  • 277
  • 381
1
2
3
25 26