Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
384 views
in Technique[技术] by (71.8m points)

android - reslayoutContact_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..

reslayoutContact_us.xml: Invalid file name: must contain only [a-z0-9_.]
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try removing the capital letter. reslayoutcontactus.xml


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...