当前位置: 动力学知识库 > 问答 > 编程问答 >

java - What is fragment_main?

问题描述:

I've recently setup eclipse and the android SDK on a new computer but I fear something has gone wrong when setting it up.

When I create a new android project with a blank activity two files I've never seen before appear:

fragment_main.xml

and

appcompat_v7_2

What are they and do I need to worry about them?

网友答案:

appcompat-v7 :

As stated in Android's Support Library Overview, it is considered good practice to include the support library by default because of the large diversity of devices and the fragmentation that exists between the different versions of Android (and thus, of the provided APIs)

Reference : Why eclipse automatically adds appcompat v7 library support whenever i create a new project

Fragment_main :

fragment_main.xml is the Layout for the fragment.

Refer this : Building a Dynamic UI with Fragments

hope this helps

网友答案:

The first, let read code in MainActivity!

You can see fragment_main is layout of one fragment in it. when application running, fragment will be added to layout and show this layout. Let read more about here for understanding about fragment. It is very important if you want to make android app.

分享给朋友:
您可能感兴趣的文章:
随机阅读: