adspace


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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What did you like better, ice cream sandwich or kitkat?

981


Which is the latest version of android?

1089


Which is the latest version of android os?

1049


What all devices have you worked on?

1060