Which of the following Activity life-cycle methods is invoked when a dialog is shown?
Answer(s): A
onPause() is where you deal with the user leaving your activity.
http://developer.android.com/reference/android/app/Activity.html
Which of the following is NOT true about class DefaultHttpClient?
Answer(s): C
Android 6.0 release removes support for the Apache HTTP client. If your app is using this client and targets Android 2.3 (API level 9) or higher, use the HttpURLConnection class instead.
http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-httpclient
Which of the following is NOT true about the SharedPreferences interface?
Answer(s): D
SharedPreferences class is an interface for accessing and modifying preference data returned by getSharedPreferences(String, int). For any particular set of preferences, there is a single instance of this class that all clients share. Modifications to the preferences must go through an SharedPreferences.Editor object to ensure the preference values remain in a consistent state and control when they are committed to storage.Objects that are returned from the various get methods must be treated as immutable by the application.
http://developer.android.com/reference/android/content/SharedPreferences.html
What does the following code do? dialog.getWindow().setFlags(LayoutParams.FLAG_BLUR_BEHIND, LayoutParams.FLAG_BLUR_BEHIND);
public static final int FLAG_BLUR_BEHIND Window flag: blur everything behind this window. Note: Added in API level 1This constant was deprecated in API level 14. Blurring is no longer supported.
http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_BLUR_BEHIND
What does the following code achieve?Intent intent = new Intent(FirstActivity.this, SecondActivity.class); startActivityForResult(intent);
Answer(s): B
startActivityForResult launches an activity for which you would like a result when it finished.
Post your Comments and Discuss Android AND-401 exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the AND-401 content, but please register or login to continue.