Android Application Development (AND-401) — Question 102
Which of the following is true about this code snippet? (Choose two)
Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:555-1234")); startActivity(intent);
Answer options
- A. This is an explicit intent that start the system’s dialer.
- B. The system will not dial the number without adding permission CALL_PHONE.
- C. The system will perform an intent resolution to start the proper activity.
- D. The code will not compile.
Correct answer: B, C
Explanation
Option B is correct because the CALL_PHONE permission is necessary to make a call directly. Option C is also correct as the system needs to resolve the intent to find the appropriate activity to handle it. Options A and D are incorrect; this is not an explicit intent and the code is valid, so it will compile without issues.