0

In my application I have one broadcast receiver. Inside the onReceive() method I am using methods from some other Helper class. Is there a chance anytime when my onReceive will be called, then the Helper class will not be available in memory and will cause ClassNotFoundException or something like that?

Sush
  • 6,839
  • 1
  • 18
  • 26
  • you can initiate helper class inside onReceive().can you share your code please. – Ramindu Weeraman Dec 28 '11 at 12:17
  • I don't have code now to explain my scenario. I just wanted to get the concept. What I plan is my helper class will have some static methods and static variables which I will use in my onReceive. So I want to know if this class will be available to the onReceive method of the BroadcastReceiver always or by any chance it will not sometime. – Sush Dec 28 '11 at 12:24
  • 1
    You can use your hepler class method inside onReceive().Because when your onReceive() method call helper class should be in memory. – Ramindu Weeraman Dec 28 '11 at 12:28

1 Answers1

2

Is there a chance anytime when my onReceive will be called, then the Helper class will not be available in memory and will cause ClassNotFoundException or something like that?

No. All classes in your APK will be available to you.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • @LalitPoptani: Please do not hijack unrelated questions and answers. Somebody with your StackOverflow experience should know better. – CommonsWare Dec 28 '11 at 13:34