简体   繁体   中英

New project missing xml files and folders

When creating a new project on Android Studio, some files are missing on my new project like:

xml files:
activity_main.xml, AndroidManifest.xml

Folders inside res folder:
layout, values

I dont know if theres more things missing. Im using windows 8 Pro

The only folders you need in your res folder are probably "values" with a "strings.xml" inside. and you need a "styles.xml" in the values fodler. copy this text to your styles.xml:

    <resources>

    <!--
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
    -->
    <style name="AppBaseTheme" parent="android:Theme.Light">
        <!--
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.
        -->
    </style>

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    </style>

</resources>

the tags have to go in the strings.xml file too. google for a androidmanifast xml file and copy that to it.

You can also check the settings when creating the project, there should be a setting that says something like: "Generate xml files"

just some ideas

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM