1

I'm working on application where I have several modules and logic running on several threads. Sometimes I need some communication between the different threads to achieve some functionality. I started using Intents for this purpose but I'm not sure if this is a good practice in Android in general or it's an overkill (in terms of usage, performance, etc) since the intent mechanism is designed to be used for inter-app communication.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
rkachach
  • 16,517
  • 6
  • 42
  • 66

1 Answers1

2

Between threads? Why? That's a bit heavyweight. Why not just pass the threads a message with a map of the parameters? Intents are optimized for cross process communication, they really shouldn't be used unless you're starting a new Context. Look into MessageQueues, Handlers, and HandlerThreads for better solutions to the problem.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127