nerdexam
Android

OA0-002 · Question #104

Which of these is the correct code which enables a BroadcastReceiver callback?

The correct answer is C. public class ReceiverSample extends BroadcastReceiver{ public void onReceive(Context context. See the full explanation below for the reasoning.

Question

Which of these is the correct code which enables a BroadcastReceiver callback?

Options

  • Apublic class ReceiverSample extends BroadcastReceiver { public void onCreate(Context context,
  • Bpublic class ReceiverSample implements BroadcastReceiver{ public void onCreate(Context
  • Cpublic class ReceiverSample extends BroadcastReceiver{ public void onReceive(Context context,
  • Dpublic class ReceiverSample implements BroadcastReceiver { public void onReceive(Context

How the community answered

(58 responses)
  • A
    5% (3)
  • B
    9% (5)
  • C
    71% (41)
  • D
    16% (9)

Community Discussion

No community discussion yet for this question.

Full OA0-002 Practice