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