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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:34:24+00:00 2026-05-23T07:34:24+00:00

hey guys I’m just writing a name getter app as I’m learning android and

  • 0

hey guys I’m just writing a name getter app as I’m learning android and I am forced to close the app when it loads in the emulator. I’m quite new so It’s probably something simple.

namegetter.java

package edu.calpoly.android.lab1;
// tools
import android.app.Activity;
import android.content.Intent;
import android.content.pm.LabeledIntent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class NameGetter extends Activity implements android.view.View.OnClickListener{
    // variables
    private android.widget.EditText textEdit_Name;
    private android.widget.Button button_Submit;
    private String string_Name;
    private android.content.Intent intent_GetText;
    private android.os.Bundle bundle;
    private android.widget.TextView textView_Top;
    @Override
      public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.name_getter);

        // assign local variables
        textEdit_Name = (EditText) this.findViewById(R.id.editText_Name);
        button_Submit = (Button) this.findViewById(R.id.button_Submit);
        textView_Top = (TextView) this.findViewById(R.id.LABEL1);
        button_Submit.setOnClickListener(this);

       bundle = this.getIntent().getExtras();

       bundle.getString(string_Name);
       textView_Top.setText(string_Name);


    }

    public void onClick(View v) {
        string_Name = textEdit_Name.getText().toString();
        // create intent to pass
        intent_GetText= new Intent(this, HelloWorld.class);
        // pass to hello world activity
        intent_GetText.putExtra(string_Name, textEdit_Name.getText().toString());
        // initiate 
        this.startActivity(intent_GetText);
    }
}

Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="edu.calpoly.android.lab1"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="12" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name="NameGetter"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="HelloWorld" ></activity>

    </application>
</manifest>
  • 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-23T07:34:25+00:00Added an answer on May 23, 2026 at 7:34 am

    The most likely cause is that getExtras() is returning null.

    bundle = this.getIntent().getExtras();
    bundle.getString(string_Name);
    

    For more help, I suggest collecting the logcat (adb logcat) and posting the actual exception.

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

Sidebar

Related Questions

Hey guys I am working on android application. My app includes an activity which
Hey guys, I'm writing a word wrap function to format console text in C++.
Hey guys I just noticed that my join statement here SELECT * FROM reports
Hey guys I can't seem to get the syntax here right, I'm just trying
Hey guys I'm running this code in Android: public ServiceServer(String serverName) { this.serverName =
hey guys here at stackoverflow.com I'm a student and developing a small todo app
Hey guys, I'm just starting out with GWT and am getting the following error
hey guys, i was using Json dll in my project from quite sometime now
Hey guys, here's my requirement: I have one central App which receives requests from
Hey guys I know that this is probably just a simple sql statement but

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.