1

I have 4 screens in my application. Instead of declaring the bluetooth broadcast receiver for all 4 activites again and again, I would like to declare once and implement in all 4 activities. How can I accomplish this?

1 Answers1

2

Create an abstract activity called AbstractActivity. Make all other activities extend this abstract Activity and declare the BroadCast Receiver in that abstract activity. For knowing a bit more about it this question might help: android how to create my own Activity and extend it?

Community
  • 1
  • 1
Shobhit Puri
  • 25,769
  • 11
  • 95
  • 124