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

  • SEARCH
  • Home
  • 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 7630749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:10:42+00:00 2026-05-31T06:10:42+00:00

Here is my email_dialog.xml layout: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical > <TableRow android:id=@+id/tableRow0 android:layout_width=match_parent

  • 0

Here is my email_dialog.xml layout:

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

<TableRow
    android:id="@+id/tableRow0"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
</TableRow>

<TableRow
    android:id="@+id/tableRow1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <EditText
        android:id="@+id/txtEmailAddress5"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textEmailAddress" 
        android:text="mFry@smithmicro.com"/>

</TableRow>

   <TableRow
    android:id="@+id/tableRow2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

       <Button
           android:id="@+id/btnCancelEmail"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:width="200px"
           android:text="Cancel" />

       <Button
           android:id="@+id/btnOkEmail"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:width="200px"
           android:text="Email" />

</TableRow>

Here is my method that calls and uses it:

void showEmailDialog() {
    // Final prevents the error in the newest onClick callback.
    final Dialog dialog = new Dialog(this);

    dialog.setContentView(R.layout.email_dialog);
    dialog.setTitle("Enter Email Address");
    dialog.setCancelable(true);

    final EditText txtEA = (EditText) findViewById(R.id.txtEmailAddress5);
    final Button cancelButton = (Button) dialog.findViewById(R.id.btnCancelEmail);
    final Button sendButton = (Button) dialog.findViewById(R.id.btnOkEmail);

    // set up cancel button
    cancelButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            dialog.dismiss();
        }

    });

    // set up send button
    sendButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            Log.d(TAG, "sendButton onClick()");
            String emailAddress;

            Log.d(TAG, "sendButton onClick() - String emailAddress");

            Log.d(TAG,
                    "sendButton onClick() - txtEmailAddress = (EditText)");

            emailAddress = txtEA.getText().toString();
            Log.d(TAG,
                    "sendButton onClick() - emailAddress = getText().toString();");

            sendEmail(emailAddress);

            dialog.dismiss();

        }
    });

    dialog.show();
    //
}

TAG is properly defined no worries there.
I keep getting:

txtEA.getText().toString() 

to throw the null point exception. I have the right R.id value which I verified like 50 times, I verify that the setContentView() is before i try to access the EditText and the two Buttons with setOnClickListener works perfect.

I could definitely use another set of eyes on this! I’ve dug around the similar questions and tried their solutions but none of them solved mine!

  • 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-31T06:10:43+00:00Added an answer on May 31, 2026 at 6:10 am

    You should do this:

     final EditText txtEA = (EditText) dialog.findViewById(R.id.txtEmailAddress5);
    

    You forgot to search for the txtEA in dialog.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm Using Camick's ListTableModel and RowTableModel from here http://tips4java.wordpress.com/2009/03/12/table-from-database/ However, the JTable is not
I'm trying to use Facebook SDK in my Android app. Here's the snippet: Facebook
I have this web app at the http://autozeep.com/cars each car have it's link to
Here's an email: mynick@myemail.com I need to store in a variable: myemail To do
Here is an example email body: Name: Jah Selassie Store Locator: Finland Service Number:
There are a number of email regexp questions popping up here, and I'm honestly
Here is my Json data: [{ok : false, details : [{n : Email, v
Using the obsolete System.Web.Mail sending email works fine, here's the code snippet: Public Shared
I'm using the post-receive-email script included with git. (Source is here .) It works
This question comes on the heels of the question asked here . The email

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.