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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:38:54+00:00 2026-05-25T11:38:54+00:00

I am creating a dialog box which is like a login screen containing two

  • 0

I am creating a dialog box which is like a login screen containing two text boxes and two buttons. I am able to create it but my problem is the two edit text boxes are overlapping with each other(Second edit text box is overlapping with the first one). It may be a simple one but since i m new to android i m stuck with it.Pls help me to solve it. Here is the source code

public class LoginActivity extends Activity {
    /** Called when the activity is first created. */
    @Override

    public void onCreate(Bundle savedInstanceState) {                        
        super.onCreate(savedInstanceState);                         
        setContentView(R.layout.main);  
        Button btn= (Button) findViewById(R.id.btn_Login);
        btn.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                showDialog(0);

            }
        });
    }

        protected Dialog onCreateDialog(int id)
        {
        final AlertDialog.Builder alert = new AlertDialog.Builder(this);                        
        final EditText input = new EditText(this); 
        final EditText input1 = new EditText(this);
        alert.setIcon(R.drawable.icon);
        alert.setTitle("Login");
        alert.setView(input);   
        alert.setView(input1);

        alert.setView(input1);
        alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {             
            public void onClick(DialogInterface dialog, int whichButton) {              
                String value = input.getText().toString().trim();                       
                Toast.makeText(getApplicationContext(), value, Toast.LENGTH_SHORT).show();   
                }                     });                 
        alert.setNegativeButton("Cancel",                  
                new DialogInterface.OnClickListener() {                           
            public void onClick(DialogInterface dialog, int whichButton) {          
                dialog.cancel();    }     });         
        return alert.create();      
        } 
    }
  • 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-25T11:38:55+00:00Added an answer on May 25, 2026 at 11:38 am

    You can create a layout XML for dialog boxes as well. Before calling your Dialog just do:

    myDialog.setContentView(R.layout.my_dialog_layout);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple modeless dialog box which I'm creating from my
I am creating an application in which an alert dialog box pops up when
I'm looking for some solution for creating modal dialog box, like when you are
I found all things working with alert box,dialog box but when i try creating
Anyone have any experience creating a modal dialog box using AJAX and ASP.NET MVC?
I am creating a dialog like in this page: http://jqueryui.com/demos/dialog/#modal-confirmation (click view source) on
I have two modal dialogs and each dialog has one edit box. I am
I have a jQuery UI Dialog box, that I'm creating. It starts out as
I know that when creating buttons, like next and previous, that the code can
I am creating JQuery dialog boxes and need the close functionality to cause a

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.