Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7898109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:20:42+00:00 2026-06-03T08:20:42+00:00

EditText txtUserName; EditText txtPassword; Button btnLogin; Button btnCancel; /** Called when the activity is

  • 0
 EditText txtUserName;
 EditText txtPassword;
 Button btnLogin;
 Button btnCancel;

    /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);


     txtUserName=(EditText)this.findViewById(R.id.txtUname);
     txtPassword=(EditText)this.findViewById(R.id.txtPwd);
     btnLogin=(Button)this.findViewById(R.id.btnLogin);

           Button  btnLogin=(Button)this.findViewById(R.id.Button01);
         btnLogin.setOnClickListener(new OnClickListener() {

             @Override
             public void onClick(View v) {
                 if((txtUserName.getText().toString()).equals(txtPassword.getText().toString())){
                     Toast.makeText(LoginappActivity.this, "Login Successful",Toast.LENGTH_LONG).show();
                    } else{
                     Toast.makeText(LoginappActivity.this, "Invalid Login",Toast.LENGTH_LONG).show(); 
                     }
                       }
                          });

           Button next = (Button) findViewById(R.id.Button01);
           next.setOnClickListener(new View.OnClickListener() {   

                public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), AddName.class);
                startActivityForResult(myIntent, 0); 
            }});

       }

 }

while running this app on emulator it runs fine without any errors but it doesnt show any message that username and password are succesfully logged or a invalid login but when i click on next button the next screen is displayed

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:20:43+00:00Added an answer on June 3, 2026 at 8:20 am

    Remove this line and check it…

      Button  btnLogin=(Button)this.findViewById(R.id.Button01);<---------Remove it
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EditText txtUserName; EditText txtPassword; Button btnLogin; Button btnCancel; /** Called when the activity is
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtUserName=(EditText)this.findViewById(R.id.txtUname); txtPassword=(EditText)this.findViewById(R.id.txtPwd); btnLogin=(Button)this.findViewById(R.id.btnLogin); Button btnLogin=(Button)this.findViewById(R.id.Button01); btnLogin.setOnClickListener(new
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtUserName=(EditText)this.findViewById(R.id.txtUname); txtPassword=(EditText)this.findViewById(R.id.txtPwd); btnLogin=(Button)this.findViewById(R.id.btnLogin); btnLogin=(Button)this.findViewById(R.id.btnLogin); btnLogin.setOnClickListener(new OnClickListener()
Thsi is my code: EditText editCategoryName, editBrandName; private ArrayAdapter<String> myAdapter1, myAdapter2; @Override public void
I have a EditText object created in the main activity in onCreate. I need
public class BabyName extends Activity implements View.OnClickListener, Runnable{ /** Called when the activity is
I have an EditText and a Button set next to each other on the
I have 2 EditText's in my layout. In the first I shuld put the
I have a Button/Edittext to reset my App-Settings.... If a press the button(no long
How to get EditText's value from sub-Activity? With a condition that if I click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.