Which of the following methods is called in an Activity when another activity gets into the foreground?
A. onStop()
B. onPause()
C. onDestroy()
D. onExit()
Which method should you use to start a sub-activity?
A. startActivity(Intent intent)
B. startActivityForResult(Intent intent)
C. startService(Intent intent)
D. startSubActivity(Intent intent)
Consider the following code :
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Menu");
AdapterContextMenuInfo cmi = (AdapterContextMenuInfo) menuInfo;
menu.add(1, cmi.position, 0, "Open file");
menu.add(2, cmi.position, 0, "Save file");}
Which of the following best explains the code above?
A. The code inflates an xml file into menu items.
B. The code creates menu items for context menu programmatically.
C. The code assign actions to menu items.
D. The code Opens a menu resource file, modifies it, and saves the changes.
Which of the following is a rule that developers must always follow when writing multi- threaded Android applications? (Choose two)
A. A worker thread must not be created from inside the UI thread.
B. Each UI thread must not create more than one worker thread.
C. The UI thread must never be blocked.
D. The Android UI must not be accessed from outside the UI thread.
You can create a custom view by extending class:
A. android.widget.View
B. android.widget.LinearLayout
C. android.view.View
D. android.content.Context
Which of the following attributes is used to set an activity screen to landscape orientation?
A. screenorientation = landscape
B. screenOrientation="landscape"
C. android:ScreenOrientation="landscape"
D. android:screenOrientation="landscape"
Which of following is incorrect about the Toast class?
A. You cannot set a custom layout for a Toast.
B. You cannot set a custom layout for a Toast There is no need to close or hide a Toast, since it closes automatically.
C. There is no need to close or hide a Toast, since it closes automatically.
D. A Toast is displayed for only one of the following periods: Toast.LENGHT_SHORT or Toast.LENGTH_LONG.
Which of the following is NOT true about class DefaultHttpClient?
A. It supports HTTPS
B. It supports streaming uploads and downloads
C. It is only supported on Android versions 2.2 and older
D. It is Andriod's default implementation of an HTTP client
What does the following code snippet do?
A. Creates a FrameView.
B. Creates a Cradview.
C. Creates a RecyclerView.
D. Creates a ListView-
Google Maps allows web sites, mobile apps and other media to connect to its database and import it in JSON format. This web connection between Google maps database and mobile applications are done through https connections and using an API key.
A. False
B. True