Having trouble creating an Android Login Page with Intents & Activities?

Try changing Intent loginIntent = new Intent(this, menuTest. Class) to Intent loginIntent = new Intent(Login. This, menuTest.

Class).

Try changing Intent loginIntent = new Intent(this, menuTest. Class); to Intent loginIntent = new Intent(Login. This, menuTest.

Class).

THANKS! This worked. Although, my code is not at 100%, your suggestion took me to the new Activity.

– jl478 Apr 24 at 20:01 sorry to be a bother, but can you explain what the difference is in Login. This vs. this? – jl478 Apr 24 at 20:03 It's a matter of scope.

The code is being called in the listener for the button. When the button is pressed, this refers to the OnClickListener, and not to Login. So, calling Login.

This changes which this is being used. – mikesir87 Aug 29 at 13:58.

These can be caused by two reasons 1) the destination activity (menuTest) may not be defined in manifest xml. 2) you may need to run inside UI thread e.g. Login.this. RunOnUiThread(new Runnable() public void run() { //lblResult.

SetText("Login successful"); Intent loginIntent = new Intent(this, menuTest. Class); startActivity(loginIntent); } }).

Both activities are defined in the manifest file. – jl478 Apr 24 at 19:58.

Ive used the setContetView function of the main activity this way you don't have to worry about the intents.

J1478 you asked "sorry to be a bother, but can you explain what the difference is in Login. This vs. this? €“ jl478 Apr 24 at 20:03" It was answered up in the comments to your question."Because he is saying 'this' inside his button onClickListener the 'this' is referring to the onClickListener and not the activity – Thomas Owers Apr 24 at 21:11" The onClickListener is an inner class, so this refers to the instance of that inner class.

To get the Login instance you need to say Login. This, which you just so happen to have access too because inner classes inherit the scoped variables of their containing classes.

I'm trying to create a generic login screen for Android. I'd like the program to check if the username and password (currently hardcoded) is listed. If the account is listed, you will be taken to a new screen called menuTest.

I have the basic login working (without activity or intents). But when I try to add the intents, I get an error. How can I fix this?

Below is my sample code.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions