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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:13:54+00:00 2026-06-13T14:13:54+00:00

I’m on this series from The New Boston on Android Development and i’m stuck

  • 0

I’m on this series from “The New Boston” on Android Development and i’m stuck on 49’th video , because i get an error (NullPointerException i think) and i can’t figure out how to solve this. The testing of the app is done on eclipse’s android emulator 5554:droidX .

package bogdy2p.ro.clicknet.web;

 import android.app.Activity;
 import android.os.Bundle;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.Button;
 import android.widget.RadioGroup;
 import android.widget.RadioGroup.OnCheckedChangeListener;
 import android.widget.TextView;

   public class OpenedClass extends Activity implements OnClickListener,OnCheckedChangeListener {

TextView question, test;
Button returnData;
RadioGroup selectionList;
String gotBread;
String setData;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.send);
    initialize();
    Bundle gotBasket = getIntent().getExtras();
    gotBread = gotBasket.getString("key");
    question.setText(gotBread);
}

private void initialize() {
    // TODO Auto-generated method stub
    question = (TextView) findViewById(R.id.tvQuestion);
    test = (TextView) findViewById(R.id.tvText);
    returnData = (Button) findViewById(R.id.bReturn);
    returnData.setOnClickListener(this);
    selectionList = (RadioGroup) findViewById(R.id.rgAnswers);
    selectionList.setOnCheckedChangeListener(this);
}

public void onClick(View arg0) {
    // TODO Auto-generated method stub
}

public void onCheckedChanged(RadioGroup arg0, int arg1) {
    // TODO Auto-generated method stub
    switch (arg1) {
    case R.id.rCrazy:
        setData = "Probably right!";
        break;

    case R.id.rSexy:
        setData = "Definetly right!";
        break;

    case R.id.rBoth:
        setData = "Spot On!";
        break;
    }
    test.setText(setData);
}
   }

LogCat From Eclipse here :

       10-29 00:43:45.111: E/AndroidRuntime(637): FATAL EXCEPTION: main
       10-29 00:43:45.111: E/AndroidRuntime(637): java.lang.RuntimeException: Unable to               start activity ComponentInfo{bogdy2p.ro.clicknet.web/bogdy2p.ro.clicknet.web.OpenedClass}: java.lang.NullPointerException
        10-29 00:43:45.111: E/AndroidRuntime(637):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
        10-29 00:43:45.111: E/AndroidRuntime(637):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
        10-29 00:43:45.111: E/AndroidRuntime(637):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
        10-29 00:43:45.111: E/AndroidRuntime(637):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
        10-29 00:43:45.111: E/AndroidRuntime(637):  at android.os.Handler.dispatchMessage(Handler.java:99)
        10-29 00:43:45.111: E/AndroidRuntime(637):  at android.os.Looper.loop(Looper.java:137)
        10-29 00:43:45.111: E/AndroidRuntime(637):  at android.app.ActivityThread.main(ActivityThread.java:4745)
         10-29 00:43:45.111: E/AndroidRuntime(637):     at java.lang.reflect.Method.invokeNative(Native Method)
        10-29 00:43:45.111: E/AndroidRuntime(637):  at java.lang.reflect.Method.invoke(Method.java:511)
        10-29 00:43:45.111: E/AndroidRuntime(637):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
         10-29 00:43:45.111: E/AndroidRuntime(637):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
         10-29 00:43:45.111: E/AndroidRuntime(637):     at dalvik.system.NativeStart.main(Native Method)
         10-29 00:43:45.111: E/AndroidRuntime(637): Caused by: java.lang.NullPointerException
         10-29 00:43:45.111: E/AndroidRuntime(637):     at bogdy2p.ro.clicknet.web.OpenedClass.onCreate(OpenedClass.java:27)
         10-29 00:43:45.111: E/AndroidRuntime(637):     at android.app.Activity.performCreate(Activity.java:5008)
         10-29 00:43:45.111: E/AndroidRuntime(637):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
         10-29 00:43:45.111: E/AndroidRuntime(637):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
         10-29 00:43:45.111: E/AndroidRuntime(637):     ... 11 more

Manifest.Xml here :

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="bogdy2p.ro.clicknet.web"
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_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="bogdy2p.ro.clicknet.web.STARTINGPOINT" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Menu"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="bogdy2p.ro.clicknet.web.MENU" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".TextPlay"
        android:label="@string/app_name" >
    </activity>
    <activity
        android:name=".Email"
        android:label="@string/app_name" >
    </activity>
    <activity
        android:name=".Camera"
        android:label="Camera Application"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".Data"
        android:label="Data Application" >
    </activity>
    <activity
        android:name=".OpenedClass"
        android:label="Opened Class" >
    </activity>
</application>

And Data.java class here :

package bogdy2p.ro.clicknet.web;

      import android.app.Activity;
      import android.content.Intent;
      import android.os.Bundle;
      import android.view.View;
      import android.view.View.OnClickListener;
      import android.widget.Button;
      import android.widget.EditText;
      import android.widget.TextView;

  public class Data extends Activity implements OnClickListener {

Button start, startFor;
EditText sendET;
TextView gotAnswer;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.get);
}

private void initialize() {

    start = (Button) findViewById(R.id.bSA);
    startFor = (Button) findViewById(R.id.bSAFR);
    sendET = (EditText) findViewById(R.id.etSend);
    gotAnswer = (TextView) findViewById(R.id.tvGot);
    start.setOnClickListener(this);
    startFor.setOnClickListener(this);
}

public void onClick(View arg0) {
    // TODO Auto-generated method stub
    switch (arg0.getId()) {
    case R.id.bSA:
        String bread = sendET.getText().toString();
        Bundle basket = new Bundle();
        basket.putString("key", bread);
        Intent a = new Intent(Data.this, OpenedClass.class);
        a.putExtras(basket);
        startActivity(a);
        break;
    case R.id.bSAFR:
        Intent i = new Intent(Data.this, OpenedClass.class);
        startActivityForResult(i, 0);
        break;
    }
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
}
 }

As far as i read into the LogCat, the problem would be @ Line 27 in OpenedClass.java file , but i can’t figure out what the problem is. My program is the same as the one in the videos, but mine does not work , and in the videos, the program runs successfully.

  • 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-13T14:13:56+00:00Added an answer on June 13, 2026 at 2:13 pm

    Your gotBasket is null at some point. That means, for some reason, your intent’s extras doesn’t exist.

    Protect your code with a try-catch or you could do something like:

    Bundle gotBasket = getIntent().getExtras();
    if(gotBasket!=null){
        gotBread = gotBasket.getString("key");
        question.setText(gotBread);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I want use html5's new tag to play a wav file (currently only supported
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.