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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:39:20+00:00 2026-05-26T09:39:20+00:00

Friends, I m quite new so sorry for the basic question but after hours

  • 0

Friends,

I m quite new so sorry for the basic question but after hours of searching I gave up.
How do i add a second EditText to my AlertDialog? It shows just one Edittext with the two Buttons.
The second EditText is not Displayed at all.

heres my code,

final AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
final EditText inputstreet = new EditText(ctx);
final EditText inputstreetnumber = new EditText(ctx);

alert.setView(inputstreet);
alert.setView(inputstreetnumber);
               alert.setTitle(getResources().getString(R.string.t_MainAlertEnterAdressTitle));
// alert.setIcon(R.drawable.huji2); // Icon disabled for now
alert.setMessage(getResources().getString(R.string.t_MainAlertEnterAdressMessage));
alert.setPositiveButton(getResources().getString(R.string.t_MainAlertEnterAdressButtonOk),
        new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog,
                    int whichButton) {


                finish();
            }
        });

alert.setNegativeButton(getResources().getString(R.string.t_MainAlertEnterAdressButtonBack),
        new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog,
                    int whichButton) {

                dialog.cancel();

            }
        });
alert.show();

I removed everything whats not important. Thanks a lot!!!

  • 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-26T09:39:20+00:00Added an answer on May 26, 2026 at 9:39 am

    Your alert dialog can only hold one view, so you have to put your EditText views inside a single layout view, like this:

    final AlertDialog.Builder alert = new AlertDialog.Builder(this);
    
    final LinearLayout layout = new LinearLayout(this);
    layout.setOrientation(LinearLayout.VERTICAL);
    
    final EditText inputstreet = new EditText(this);
    final EditText inputstreetnumber = new EditText(this);
    
    layout.addView(inputstreet);
    layout.addView(inputstreetnumber);
    
    alert.setView(layout);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Friends, I spent quite some time on this one... but cannot yet figure
I'm quite new in iPhone Programming, but I'm trying to do my best cause
This been bugging me for quite a few hours. I've been searching a lot
Friends, I know how to deploy and retrieve a single element in LINQ, but
friends, i have a EditText on simple activity with a button. when every i
Basically a friends just gifted me an old domain to develop, it has quite
I'm doing a small project in C after quite a long time away from
I'm new to MongoDB, and went with MongoMapper for some associations help. I'm quite
This seems like it should be quite obvious but something about the entity framework
After googling for a while, I'm aware that there quite a few ways to

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.