In android, is it possible to register an inner class of a class as Broadcast receiver?
public class A extends AnotherClass {
public class B extends BroadcasetReceiver {
}
}
how can I register B of A to listen for an intent?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In that case you can consider registering it with the Context.registerReceiver(). If you can make it static try to reference it this way from your AndroidManifest:
AnotherClass$BroadcasetReceiver. Well… if it’s static, why don’t just create a top-level class?