Free AND-401 Exam Braindumps
Android Application Development Questions 46–50 (page: 11)

Updated On: 9-Feb-2026

Which of the following Activity life-cycle methods is invoked when a dialog is shown?

  1. onPause()
  2. onCreate()
  3. onStop()
  4. onDestroy()

Answer(s): A

Explanation:

onPause() is where you deal with the user leaving your activity.


Reference:

http://developer.android.com/reference/android/app/Activity.html



Which of the following is NOT true about class DefaultHttpClient?

  1. It supports HTTPS.
  2. It supports streaming uploads and downloads.
  3. It is only supported on Android versions 2.2 and older.
  4. It is Andriod’s default implementation of an HTTP client.

Answer(s): C

Explanation:

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.


Reference:

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?

  1. The data it saves is persistent even if application is killed.
  2. It only saves primitive data in key-value pairs.
  3. Modifications to preferences saved should go through class SharedPreferences.Editor
  4. It can save any data type in key-value pairs.

Answer(s): D

Explanation:

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.


Reference:

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);

  1. When dialog is displayed the activity behind it will be blurred.
  2. When dialog is displayed the activity behind it will be dimmed.
  3. Any EditText behind the dialog will be disabled.
  4. When the dialog is displayed, the edges of the dialog will be blurred.

Answer(s): A

Explanation:

public static final int FLAG_BLUR_BEHIND
Window flag: blur everything behind this window.
Note: Added in API level 1
This constant was deprecated in API level 14.
Blurring is no longer supported.


Reference:

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);

  1. Starts a browser activity
  2. Starts a sub-activity
  3. Starts an activity service
  4. Sends results to another activity.

Answer(s): B

Explanation:

startActivityForResult launches an activity for which you would like a result when it finished.


Reference:

http://developer.android.com/reference/android/app/Activity.html



Viewing page 11 of 47
Viewing questions 51 - 55 out of 228 questions


Post your Comments and Discuss Android AND-401 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!