Android Adapter and Views - questions and answers

Android Adapter and Views - questions and answers


Q.1 What is the default layout in android application?

A) RelativeLayout
B) TableLayout
C) LinearLayout
D) FrameLayout
View Answer / Hide Answer

ANSWER: A




Q.2 When a button is clicked, which listener you can use?

A) SetOnClickListener
B) OnClickListener
C) ClickListener
D) None of the above.
View Answer / Hide Answer

ANSWER: B




Q.3 OnCheckedChangeListener can be used with which control?

A) RadioButton
B) CheckBox
C) Option A and B are correct.
D) None of the above.
View Answer / Hide Answer

ANSWER: C




Q.4 To display text which control you will use?

A) EditText
B) TextView
C) label
D) None of the above.
View Answer / Hide Answer

ANSWER: B




Q.5 Which method sets the minimum number of characters the user must type before the suggestions appear as a drop-down menu, while working with ArrayAdapter?

A) SetMinChar()
B) MinChar()
C) setThreshold()
D) None of the above.
View Answer / Hide Answer

ANSWER: C




Q.6 What code you will write to create an array in strings.xml fi le located in the res/values folder?

A)

<string-array name=”days”>
<item>Sunday</item>
<item>Monday</item>
<item>Tuesday</item>
</string-array>

B)

<string name=”days”>
<item>Sunday</item>
<item>Monday</item>
<item>Tuesday</item>
</string>

C)

string item[3];
<item>Sunday</item>
<item>Monday</item>
<item>Tuesday</item>

D) None of the above.
View Answer / Hide Answer

ANSWER: A




Q.7 How will you access the array that is created in strings.xml file located in the res/values folder? Suppose that array name is days and spinner control is used.

A) ArrayAdapter adapter= ArrayAdapter.createFromResource(this, R.array.days, android.R.layout.simple_spinner_item);
B) findViewByID(days);
C) String arr[]=(array)findViewByID(days);
D) None of the above.
View Answer / Hide Answer

ANSWER: A




Q.8 You can shut down an activity by calling which method?

A) finishActivity()
B) finish()
C) destroy()
D) None of the above.
View Answer / Hide Answer

ANSWER: B




Q.9 To embed a web browser in your activity which view you will use?

A) RichTextView
B) Browser
C) WebView
D) None of the above.
View Answer / Hide Answer

ANSWER: C




Q.10 How will you access the array that is created in .java file ? Suppose that array name is days.

A) ArrayAdapter<String> adapter = new ArrayAdapter<String> (days);
B) ArrayAdapter<String> adapter = new ArrayAdapter<String> (this, android.R.layout.simple_dropdown_item_1line, days);
C) ArrayAdapter<String> adapter = new ArrayAdapter<String> (android.R.layout.simple_dropdown_item_1line, days);
D) None of the above.
View Answer / Hide Answer

ANSWER: B




Q.11 Which control works as a dropdownlist in Android?

A) ComboBox
B) List
C) Spinner
D) None of the above.
View Answer / Hide Answer

ANSWER: C




Q.12 Which component is not activated by Intent?

A) Services
B) Activity
C) contentProvider
D) None of the above.
View Answer / Hide Answer

ANSWER: C


Post your comment

    Discussion

  • RE: Android Adapter and Views - questions and answers -Ajay shetkari (07/24/22)
  • very challeging mcqs i got to learn soo much about andriod and its components like views,services and much more
  • RE: Android Adapter and Views - questions and answers -Akshay Lover (07/24/22)
  • I want a girlfriend.
    Who's father name should be starting with S
    Her qualification should be 12 fail and diploma and Langdi and SC