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 6011755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:18:19+00:00 2026-05-23T02:18:19+00:00

I am working on validation of two edit text fields in my login page

  • 0

I am working on validation of two edit text fields in my login page and little change in my idea. I need to show textview above this field if the user left field e1 without entering text and goes to e2. Any help is appreciated.

Here is my code:

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

;
public class LoginActivity extends Activity {
    EditText usernameText;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.loginpage);
        Button login = (Button) findViewById(R.id.loghomebutton);
        Button newuser = (Button) findViewById(R.id.lognewuserbutton);
        EditText usernameText = (EditText)this.findViewById(R.id.emaileditlog);
        EditText passwordText = (EditText)this.findViewById(R.id.pwdeditlog);


    login.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub

            Intent myIntent = new Intent(v.getContext(),
                    SettingsActivity.class);
            startActivityForResult(myIntent, 0);
            overridePendingTransition(R.anim.fadeout, 0);
        }
    });
    newuser.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent myIntent = new Intent(v.getContext(),
                    RegisterActivity.class);
            startActivityForResult(myIntent, 1);
            overridePendingTransition(R.anim.fadeout, 0);
        }
    });

}

}

  • 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-05-23T02:18:19+00:00Added an answer on May 23, 2026 at 2:18 am

    in XML add a textview above the edittext.. set textviews android:visibility="GONE" then in java code do this..

    if(editText.getText.toString().equals(" "))
                       {
                       TextView t = findViewById(.......)
                       t.setVisibility(View.VISIBLE);
                       t.setText("..............");
                       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

for email validation I have these two input fields: <input class=inputbox type=text name=data[subscriber][email] id=field_email
I have been working with some sort of validation in which i need to
I am using two validation summaries, but they don't show error message.While required field
I'm working on an application with two input fields that's validated in different ways
I'm working on an MVC page that requires conditional validation. When a user selects
I have created a user login Dialog Box in MFC, which have two edit
What happens: When I write two values in both text boxes, the page doesn't
I have created a validation with two checkbox. both validations are working fine with
I am using two forms of text validation (one when they click Next, another
Suppose i have two text fields t1 and t2 and when T1 is entered

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.