0

I have an Android app that has an Application class and I have another class that extends PhoneStateListener.

I would like to use one of the objects from the Application class in my class that extends the PhoneStateListener. I wasn't able to do so because it the PhoneStateListener class doesn't extend Activity.

Is there any way I can use the object from the Application class within my PhoneStateListener class?

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
RagHaven
  • 4,156
  • 21
  • 72
  • 113

2 Answers2

0

Extend PhoneStateListener and have a constructor that takes what it wants as argument.

Dheeraj Vepakomma
  • 26,870
  • 17
  • 81
  • 104
0

See this example and this Question

Community
  • 1
  • 1
MAC
  • 15,799
  • 8
  • 54
  • 95