I have an activity in my app, when i call the line
EditText username = (EditText)findViewById(R.id.usernameText);
the app crashes, why is this?
I have an activity in my app, when i call the line
EditText username = (EditText)findViewById(R.id.usernameText);
the app crashes, why is this?
The view has not been inflated, or you are missing
setContentView(R.layout.layout_file);
Yeah either setContentView hasn't been called in onCreate of the activity, or else the view you are trying to get isn't an EditText. What is the Exception you are getting? If its ClassCast then its not an EditText.
Things to check as no more information is provided:
Also, if you can edit the post and add the log of what's messing up, it will be more easy to reply.