Home>IT Tests>Questions>What is the output of the following code?
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button = findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO: Add your code here
}
});
}
}
Question from the Android test
What is the output of the following code? public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button button = findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO: Add your code here } }); } }
Hard
In the Android design library, what is the purpose of the CoordinatorLayout?
Author: Nicolas LaurentStatus: PublishedQuestion passed 369 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!
Similar QuestionsMore questions about Android
5
What is the purpose of a RecyclerView in Android?2
In the onStop() method. I am sure that this callback will always be called and it is likely to be returned only a few times.2
What is the name of the Android runtime?1
How to start a service in Android1
What is the name of the Android tool that is used to generate the R.java file?