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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:57:12+00:00 2026-06-12T04:57:12+00:00

I have completed the email application that is taught by The New Boston site.

  • 0

I have completed the email application that is taught by The New Boston site. As far as I have reviewed, everything is fine. My app runs just fine, but just when I press the "Send Email" Button, the app crashes. I am testing the app on my HTC Desire S. Please help me with this.

My manifest file:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thenewboston.pok"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.SET_WALLPAPER"/>

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".Splash"
        android:label="@string/title_activity_the_new_boston" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".TheNewBostonActivity"
        android:label="Add and Sub 1" >
        <intent-filter>
            <action android:name="com.thenewboston.pok.THENEWBOSTONACTIVITY" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Menu"
        android:label="Select An Application" >
        <intent-filter>
            <action android:name="com.thenewboston.pok.MENU" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".TextPlay"
        android:label="Text Play!" >          
    </activity>
    <activity
        android:name=".Email"
        android:label="Email Application" >
        <intent-filter>
            <action android:name="com.thenewboston.pok.EMAIL" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>          
    </activity>
    <activity
        android:name=".Camera"
        android:label="Camera Application"
        android:screenOrientation="portrait" >          
    </activity>
    <activity
        android:name=".Data"
        android:label="Rate It!!"
        android:screenOrientation="portrait" >          
    </activity> 
    <activity
        android:name=".OpenedClass"
        android:label="Rate It!!"
        android:screenOrientation="portrait" >          
    </activity>            

</application>

The Email activity:

public class Email extends Activity implements View.OnClickListener{

EditText personsEmail, intro, personsName, stupidThings, hatefulAction, outro;
String emailAdd, beginning, name, stupidAction, hateAct, end;
Button sendEmail;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.email);
    initializeVars();
    sendEmail.setOnClickListener(this);

}

private void initializeVars() {
    // TODO Auto-generated method stub
    personsEmail = (EditText) findViewById(R.id.etEmails);
    stupidThings = (EditText) findViewById(R.id.etThings);
    intro = (EditText) findViewById(R.id.etIntro);
    personsName= (EditText) findViewById(R.id.etName);
    hatefulAction= (EditText) findViewById(R.id.etAction);
    sendEmail= (Button) findViewById(R.id.bSentEmail);
}

public void onClick(View v) {
    // TODO Auto-generated method stub
    convertEditToString();
    String emailAddress[] = {"emailAdd"};
    String message = "Well hello "
            + name
            + " I just wanted to say "
            + beginning
            + ".  Not only that but I hate when you "
            + stupidAction
            + ", that just really makes me crazy.  I just want to make you "
            + hateAct
            + ".  Welp, thats all I wanted to chit-chatter about, oh and "
            + end
            + ".  Oh also if you get bored you should check out www.mybringback.com"
            + '\n' + "PS. I think I love you...  :-(  ";

    Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
    emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, emailAddress);
    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Hello");
    emailIntent.setType("plain/text");
    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);
    startActivity (emailIntent);

    }

    private void convertEditToString() {
        // TODO Auto-generated method stub
        emailAdd = personsEmail.getText().toString();
        beginning = intro.getText().toString();
        name = personsName.getText().toString();
        hateAct = hatefulAction.getText().toString();
        stupidAction = stupidThings.getText().toString();
        end = outro.getText().toString();
    }
    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
        finish();
    }

}

My email.xml:

   <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:weightSum="100" android:layout_height="match_parent">
<ScrollView android:layout_weight="30" android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <LinearLayout android:orientation="vertical"
        android:layout_width="match_parent" android:layout_height="match_parent">
        <TextView android:text="Email address(es):"
            android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
        <EditText android:layout_height="wrap_content"
            android:layout_width="match_parent" android:id="@+id/etEmails">
        </EditText>
        <TextView android:text="Hateful Intro:"
            android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
        <EditText android:layout_height="wrap_content"
            android:layout_width="match_parent" android:id="@+id/etIntro"></EditText>
        <TextView android:text="Person's name" android:layout_width="wrap_content"
            android:layout_height="wrap_content"></TextView>
        <EditText android:layout_height="wrap_content"
            android:layout_width="match_parent" android:id="@+id/etName"></EditText>
        <TextView android:text="Stupid Things that this Person does"
            android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
        <EditText android:layout_height="wrap_content"
            android:layout_width="match_parent" android:id="@+id/etThings"></EditText>
        <TextView android:text="What you want to do to this person:"
            android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
        <EditText android:layout_height="wrap_content"
            android:layout_width="match_parent" android:id="@+id/etAction"></EditText>
        <TextView android:text="Hateful Outro" android:layout_width="wrap_content"
            android:layout_height="wrap_content"></TextView>
        <EditText android:layout_height="wrap_content"
            android:layout_width="match_parent" android:id="@+id/etOutro"></EditText>
    </LinearLayout>
</ScrollView>
<LinearLayout android:orientation="vertical"
    android:layout_width="match_parent" android:layout_weight="40"
    android:layout_height="fill_parent">
    <Button android:text="Send Email" android:id="@+id/bSentEmail"
        android:layout_width="fill_parent" android:layout_height="fill_parent"></Button>
</LinearLayout>
<LinearLayout android:orientation="vertical"
    android:layout_width="match_parent" android:layout_weight="30"
    android:layout_height="fill_parent">
    <AnalogClock android:id="@+id/analogClock1"
        android:layout_width="fill_parent" android:layout_height="fill_parent"></AnalogClock>
</LinearLayout>

The LogCat with the NullPointerException:

10-02 22:15:40.603: E/AndroidRuntime(28009): FATAL EXCEPTION: main
10-02 22:15:40.603: E/AndroidRuntime(28009): java.lang.NullPointerException
10-02 22:15:40.603: E/AndroidRuntime(28009):    at com.thenewboston.pok.Email.convertEditToString(Email.java:69)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at com.thenewboston.pok.Email.onClick(Email.java:38)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at android.view.View.performClick(View.java:3549)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at android.view.View$PerformClick.run(View.java:14393)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at android.os.Handler.handleCallback(Handler.java:605)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at android.os.Handler.dispatchMessage(Handler.java:92)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at android.os.Looper.loop(Looper.java:154)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at android.app.ActivityThread.main(ActivityThread.java:4945)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at java.lang.reflect.Method.invokeNative(Native Method)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at java.lang.reflect.Method.invoke(Method.java:511)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
10-02 22:15:40.603: E/AndroidRuntime(28009):    at dalvik.system.NativeStart.main(Native Method)
  • 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-06-12T04:57:13+00:00Added an answer on June 12, 2026 at 4:57 am

    The reason for that NullPointerException is that you didn’t initialize the last EditText the one with the id etOutro. Just add this line in the initializeVars method:

    outro = (EditText) findViewById(R.id.etOutro);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My level of knowledge so far is such that I have completed The Little
I have a powershell script that runs a console .exe application. The console application
I have an application that sends email by relaying it through sendmail. Can I
I have an application that sends email and fax notifications when an item is
I have completed my program and would like to send that program in its
I am a beginner in I phone development.I have completed an application.Now i am
How can I launch an application with administrator rights after I have completed an
Problem: Blank email from PHP web application. Confirmed: App works in Linux, has various
I have a script that sends an email using the paypal IPN after a
First I'm quite new to ruby and rails... I have a little application working

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.