简体   繁体   English

res \ layout \ Contact_us.xml:文件名无效:必须仅包含[a-z0-9_。]

[英]res\layout\Contact_us.xml: Invalid file name: must contain only [a-z0-9_.]

public class main extends Activity {

    EditText username,password1;
    Button sub;
    String uname,pass;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        sub = (Button) findViewById(R.id.btn_submit);
        sub.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                username = (EditText) findViewById(R.id.uname);
                password1 = (EditText) findViewById(R.id.editText2);
                uname = (String) username.getText().toString();
                pass = (String) password1.getText().toString();

                if (uname.equalsIgnoreCase("uname"))
                    if (pass.equalsIgnoreCase("pass"))
                        Toast.makeText(main.this, "user is authenticated", Toast.LENGTH_LONG).show();
                    else
                        Toast.makeText(main.this, "Password Invalid", Toast.LENGTH_LONG).show();
                else
                    Toast.makeText(main.this, "User or Password Invalid", Toast.LENGTH_LONG).show();
            }
        });
    }
}

code showing the following error.. 代码显示以下错误..

res\layout\Contact_us.xml: Invalid file name: must contain only [a-z0-9_.]

Try removing the capital letter. 尝试删除大写字母。 res\\layout\\contactus.xml

You need to use lowercase letters. 你需要使用小写字母。 You have 'C' you must rename it to contact_us.xml. 您有'C',您必须将其重命名为contact_us.xml。

Make C to c. 将C转换为c。 Use lower case letters and no symbols 使用小写字母,没有符号

使用小写字母并清理包裹

it should be contactus.xml, You should follow below listed naming convention: 它应该是contactus.xml,你应该按照下面列出的命名约定:

File name must contain only lowercase az, 0-9, or _. 文件名必须仅包含小写az,0-9或_。

only a-z,mind that not capital...and white-space not allowed

name must start with a character.not with a Number(0-9)

name only _ symbol allowed.no other symbol alowed.

try naming xml layout with small letters. 尝试使用小写字母命名xml布局。 worked for me Contact_us.xml change this to contact_us.xml 为我工作Contact_us.xml将此更改为contact_us.xml

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 出现错误错误:res / menu / mainMenu.xml:无效的文件名:必须仅包含[a-z0-9_。] - getting error Error:res/menu/mainMenu.xml:invalid file name:must contain only[a-z0-9_.] 无效的文件名:必须仅包含[a-z0-9_。] - Invalid file name: must contain only [a-z0-9_.] "“无效的文件名:必须仅包含 [a-z0-9_.]”,用于 Android Studio 中的声音文件" - “INVALID FILE NAME: MUST CONTAIN ONLY [a-z0-9_.]“ for sound files in Android Studio java android:res \\ drawable-hdpi \\ Restaurant-Blue-2-icon.png:无效的文件名:必须仅包含[a-z0-9_。],无法修复 - java android: res\drawable-hdpi\Restaurant-Blue-2-icon.png: Invalid file name: must contain only [a-z0-9_.], cant fix 为什么android xml文件名必须只包含小写字母和数字([a-z0-9_。])? - Why android xml file name must contains only lowercase letters and digits ([a-z0-9_.])? aapt: res/layout/MainActivity.java 无效的文件名 - aapt: res/layout/MainActivity.java Invalid file name Android布局XML文件只能包含行吗? - Can an Android layout XML file contain only rows? Android Studio 解决方法:基于文件的资源名称必须仅包含小写 az、0-9 或下划线 - Android Studio Workaround: File-based resource names must contain only lowercase a-z, 0-9, or underscore Android:在res中使用SVG会导致错误:“文件名必须以.xml或.png结尾” - Android: Using SVG in res leads to error: “The file name must end with .xml or .png” 为什么这行 xmlns:android="http://schemas.android.com/apk/res/android" 必须是布局 xml 文件中的第一行? - Why this line xmlns:android=“http://schemas.android.com/apk/res/android” must be the first in the layout xml file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM