Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Task 4: Implement the Share This Text button

Task 5: Receive an implicit Intent


Coding Challenge

Homework
Question 1

Which constructor method do you use to create an implicit Intent to launch a camera app?

 new Intent()
 new Intent(Context context, Class<?> class)
 new Intent(String action, Uri uri)
 new Intent(String action)
Question 2

When you create an implicit Intent object, which of the following is true?

 Don't specify the specific Activity or other component to launch.


 Add an Intent action or Intent categories (or both).
 Resolve the Intent with the system before calling startActivity() or startActivityforResult().
 All of the above.

Question 3

Which Intent action do you use to take a picture with a camera app?

 Intent takePicture = new Intent(Intent.ACTION_VIEW);


 Intent takePicture = new Intent(Intent.ACTION_MAIN);
 Intent takePicture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
 Intent takePicture = new Intent(Intent.ACTION_GET_CONTENT);
Lesson 3.1
Task 1: Explore the SimpleCalc project and app

Task 2: Run SimpleCalc in the debugger


Homework

Question 1

Run the SimpleCalc app without the debugger. Leave one or both of the EditText elements empty, and
try any calculation. Why did the error occur?

 java.lang.NumberFormatException: empty String


 W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED
 The app may be doing too much work on its main thread.
 The code cache capacity was increased to 128KB.

Question 2

Which function do you perform in the Debug pane in order to execute the current line where the
breakpoint is, and then stop at the next line in the code? Choose one:

 Step Into
 Step Over
 Step Out
 Resume

Question 3

Which function do you perform in the Debug pane in order to jump to the execution of a method call
from the current line where the breakpoint is? Choose one:

 Step Into
 Step Over
 Step Out
 Resume

You might also like