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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:16:03+00:00 2026-05-15T21:16:03+00:00

Using the following code snippets, I’m trying to get the text value which has

  • 0

Using the following code snippets, I’m trying to get the text value which has been typed in to the EditTexts.

LayoutInflater factory = LayoutInflater.from(this);
final View loginView = factory.inflate(R.layout.login, null);

b.setOnClickListener(new OnClickListener() {
    public void onClick(View v) {
        Dialog d = new AlertDialog.Builder(NewOrder.this)
            .setIcon(R.drawable.icon)
            .setTitle("Log In")
            .setView(loginView)
            .setPositiveButton("Log In", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton) {
                    mSpinner = ProgressDialog.show(mContext, "", "Authenticating User...");
                    new LoginTask().execute();
                }
            })
            .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton) {
                    /* User clicked cancel so do some stuff */
                }
            })
            .create();
        d.show();
    }
});

My login.xml is pretty standard and straight forward:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <TextView
        android:id="@+id/username_view"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_marginLeft="20dip"
        android:layout_marginRight="20dip"
        android:text="Email Address"
        android:gravity="left"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <EditText
        android:id="@+id/username"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:layout_marginLeft="20dip"
        android:layout_marginRight="20dip"
        android:scrollHorizontally="true"
        android:autoText="false"
        android:capitalize="none"
        android:gravity="fill_horizontal"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/password_view"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_marginLeft="20dip"
        android:layout_marginRight="20dip"
        android:text="Password"
        android:gravity="left"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <EditText
        android:id="@+id/password"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:layout_marginLeft="20dip"
        android:layout_marginRight="20dip"
        android:scrollHorizontally="true"
        android:autoText="false"
        android:capitalize="none"
        android:gravity="fill_horizontal"
        android:password="true"
        android:textAppearance="?android:attr/textAppearanceMedium" />

</LinearLayout>

When someone clicks the PositiveButton, how do I get the value of the EditText fields?

  • 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-15T21:16:04+00:00Added an answer on May 15, 2026 at 9:16 pm
    .setPositiveButton("Log In", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {
            mSpinner =  ProgressDialog.show(mContext, "", "Authenticating     User...");
    
            /* == Get EditText Values Example == */
            EditText edtext_username=  (EditText) findViewById(R.id.username);
            EditText edtext_password=  (EditText) findViewById(R.id.password);
    
            String ValueofUsername = edtext_username.getText().toString(); 
            String ValueofPassword = edtext_password.getText().toString();
            /* ========== End Example ========== */
    
            new LoginTask().execute();
        }
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 495k
  • Answers 495k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could overwrite the default template. Use Triggers to specific… May 16, 2026 at 11:19 am
  • Editorial Team
    Editorial Team added an answer You need to output the HTML for a link. Something… May 16, 2026 at 11:19 am
  • Editorial Team
    Editorial Team added an answer $new_array = array(); $count = 0; foreach ($original_array as $key… May 16, 2026 at 11:19 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am using the following code snippets to insert values using stored procedure. the
Suppose I have the following code snippets, i.e. goo call foo, DataTable created by
I'm using the following code to print an image from a PictureBox. All works
I'm using the following code to control a div with the ID 'sidebar' var
I am using the following code to open a popup window and passing the
I am using the following code to fetch all mails since 1 day less
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have some JSP code, which writes a tree representing hierachical data. This data
I am using VS 2010 RC with .NET 4.0, and have been writing console
Consider following snippet code for xml. <rootnode> <child id=child1 ><![CDATA[child 1]]></child> <child id=child2 ><![CDATA[child

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.