Premium

Associate Android Developer Certification Questions and Answer (Dumps and Practice Questions)



Question : The following program uses an Intent to open a Web page designated by a Web browser. Which is
the correct code that goes into (1)?

Intent intent = new Intent (" (1) " , Uri.parse("http://www.HadoopExam.com/logo.jpg"));
startActivity(intent);


 : The following program uses an Intent to open a Web page designated by a Web browser. Which is
1. android.intent.VIEW

2. android.intent.action.VIEW

3. Access Mostly Uused Products by 50000+ Subscribers

4. androidJntent.action.View

Correct Answer : Get Lastest Questions and Answer :
Explanation: Create an intent with a given action. All other fields (data, type, class) are null. Note that the action must be in a namespace because Intents are used globally in the system -- for example the system VIEW action is android.intent.action.VIEW; an application's custom action would be something like com.google.app.myapp.CUSTOM_ACTION.




Question : Which code acquires a MediaPlayer class instance?

 : Which code acquires a MediaPlayer class instance?
1. MediaPlayer.create(this, R.raw.music);

2. newMediaPlayer(this, R.raw.music);

3. Access Mostly Uused Products by 50000+ Subscribers

4. MediaPlayer.newInstancefthis, R.raw.music),

Correct Answer : Get Lastest Questions and Answer :
Explanation: MediaPlayer.create() needs a Context as first parameter. Pass in the current Activity and it should work.

public void playClick(Context context){
mp = MediaPlayer.create(context, R.raw.click);
mp.start();
}


Related Questions


Question : The following program uses an Intent to open a Web page designated by a Web browser. Which is
the correct code that goes into (1)?

Intent intent = new Intent (" (1) " , Uri.parse("http://www.HadoopExam.com/logo.jpg"));
startActivity(intent);


 : The following program uses an Intent to open a Web page designated by a Web browser. Which is
1. android.intent.VIEW

2. android.intent.action.VIEW

3. Access Mostly Uused Products by 50000+ Subscribers

4. androidJntent.action.View


Question : Which code acquires a MediaPlayer class instance?

 : Which code acquires a MediaPlayer class instance?
1. MediaPlayer.create(this, R.raw.music);

2. newMediaPlayer(this, R.raw.music);

3. Access Mostly Uused Products by 50000+ Subscribers

4. MediaPlayer.newInstancefthis, R.raw.music),


Question : Which of the following is a valid sequence of invokes to Activity lifecycle methods? (Select Two)
A. onCreate > onStart > onResume > onPause> onStop> onCreate
B. onCreate > onStart > onResume > onPause> onStop>onRestart
C. onCreate > onStart > onResume > onPause> onStop>onDestroy
D. onCreate > onStart > onResume > onPause> onStop>onResume
 : Which of the following is a valid sequence of invokes to Activity lifecycle methods? (Select Two)
1. A,B
2. B,C
3. C,D
4. A,D


Question : Which of the following is true about this code snippet? (Choose two)

Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:555-1234"));
startActivity(intent);

A. This is an explicit intent that start the system's dialer.
B. The system will not dial the number without adding permission CALL_PHONE.
C. The system will perform an intent resolution to start the proper activity.
D. The code will not compile.
 : Which of the following is true about this code snippet? (Choose two)
1. A,B
2. B,C
3. C,D
4. A,D
5. A,D


Question : Which of the following are layout-related methods called by the framework on views, and you can override them when customizing a view? (Choose two)

A. onMeasure().
B. onDraw().
C. onKeyUp().
D. onSizeChanged().
 : Which of the following are layout-related methods called by the framework on views, and you can override them when customizing a view? (Choose two)
1. A,B
2. B,C
3. C,D
4. A,D