[英]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.