In android, what is the meaning of the following code in mainactivity class?



In android, what is the meaning of the following code in mainactivity class?..

Answer / Punit Kumar Rana

The provided code `setContentView(R.layout.activity_main);` initializes the layout for the MainActivity in Android. The `setContentView()` method sets the view that should be displayed inside the activity's main UI container. In this case, it sets the content of the activity to the layout defined in the activity_main.xml file, which is usually located under the res/layout directory.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Android OS Interview Questions

What is src/ directory?

1 Answers  


What is android version 7.0 called?

1 Answers  


State the code names of android along with the year when they were brought in?

1 Answers  


How many apps are available for Android?

1 Answers  


What is onlistitemclick()?

1 Answers  


State the life cycle methods of android activities?

1 Answers  


What is the google android sdk?

1 Answers   Arigo Infotech,


Explain application of shared preference?

1 Answers  


What is a widget on android?

1 Answers  


Which is the best ui for android?

1 Answers  


Explain me what is the difference between service and intentservice? How is each used?

1 Answers  


How do you find memory leaks in the mobile app on android platform?

1 Answers  


Categories