Multiple Choice
The easiest way of adding menu items (to specify the options menu for an activity) is inflating an XML file into the Menu via MenuInflater. With menu_main.xml we can do it in this way:
A) @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater() .inflate(R.menu.menu_main, menu) ;
return true;
}
B) @Override
public boolean onOptionsItemSelected(MenuItem item) {
getMenuInflater() .inflate(R.menu.menu_main, menu) ;
return super.onOptionsItemSelected(item) ;
}
C) @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState) ;
setContentView(R.menu.menu_main) ;
}
Correct Answer:

Verified
Correct Answer:
Verified
Q21: @Query is the main annotation used in
Q22: Each time your test invokes onView() ,
Q23: Relative positioning is one of the basic
Q24: In a class PreferenceFragmentCompat . As a
Q25: RecyclerView is a subclass of ViewGroup and
Q27: What is the incorrect statement about Data
Q28: If you want the Database Inspector to
Q29: <img src="https://d2lvgg3v3hfg70.cloudfront.net/C1428/.jpg" alt=" What is illustrated
Q30: What statements about InputStreamReader (java.io.InputStreamReader) are correct?
Q31: To automate UI tests with Android Studio,