Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the activity xml file to which the activity in manifest file corresponds to?

Tags:

android

xml

I am an Android newbie, so this question might sound a little silly....

So far, I know that you can know which activity is the Main one (ie which activity is launched when the activity first starts) by finding the intent-filter as such:

<intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

But, my problem is that how does Android know which XML file corresponds to that activity?? I have downloaded some source code for learning, and there are many XML files, each one for a different activity. So, I am kind of lost as to how to find the XML file for one particular activity.....

like image 916
coffeeak Avatar asked Jan 26 '26 17:01

coffeeak


1 Answers

Go in your MainActivity (LAUNCHER Activity) and inside onCreate method look for this :

setContentView(R.layout.main_activity);

the layout under this method argument will solve your issue. Ctrl+click on ".main_activity" will get you to that xml, "main_activity is the name of layout here"

Note procedure will be same for all activities

like image 89
Syed Nazar Muhammad Avatar answered Jan 28 '26 06:01

Syed Nazar Muhammad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!