What two methods you have to override when implementing Android option menus?
A. onCreateOptionsMenu, onCreateContextMenu
B. onCreateContextMenu, onContextItemSelected
C. onCreateOptionsMenu, onOptionsItemSelected
D. onCreateOptionsMenu, onContextItemSelected
正解:C
質問 2:
M ethod onDraw() of class android.view.View has the following signature:
A. public void onDraw(Canvas)
B. public void onDraw(Color)
C. public Canvas onDraw()
D. public boolean onDraw(Canvas)
正解:A
質問 3:
To add a new Activity to your application, you need to perform the following steps:
A. Create a Java class that extends View, set a layout, and add an Activity tag in AndroidManifest.xml.
B. Create a Java class that extends Activity, add an Activity tag in AndroidManifest.xml, and create a layout for the activity.
C. Add an Activity tag to AndroidManifest.xml, and add ACTIVITY permission.
D. Create layout resource only.
正解:B
質問 4:
What are the main two types of thread in Android?
A. Main thread and worker threads.
B. Main thread and UI thread.
C. Activities and services.
D. Main thread and background process.
正解:A
質問 5:
Which manifest file permission you should add to allow your application to read the device's address book?
A. READ_PHONE_STATE
B. READ_CONTACTS
C. READ_PHONE_CONTACTS
D. READ_ADDRESS_DATA
正解:B
質問 6:
Which of the following methods is called in an Activity when another activity gets into the foreground?
A. onStop()
B. onExit()
C. onPause()
D. onDestroy()
正解:C