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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:00:23+00:00 2026-06-03T23:00:23+00:00

I added another button to my app but now the app crashes on start

  • 0

I added another button to my app but now the app crashes on start up. Here is the code that I added in, when I block it out the app runs fine.

btnnext.setOnClickListener(new View.OnClickListener() {

    public void onClick(View v) {

        startActivity(new Intent("com.com.com.addtask"));
    }
});

}

I think it might be a problem with the manifest so here is the manifest too (and this is only a playing around app so dont hassle me about the package being com.com.com)

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

<uses-permission android:name="android.permission.INTERNET"/>

<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:permission="android.permission.INTERNET">
    <activity android:name=".HelloWorldActivity"
              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=".addtask"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="com.com.com.addtask" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

</application>
</manifest>

And this might be helpful too:

05-16 21:21:55.446: E/AndroidRuntime(581): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.com.com/com.com.com.HelloWorldActivity}: java.lang.NullPointerException
  • 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-03T23:00:26+00:00Added an answer on June 3, 2026 at 11:00 pm

    Have you declared the new button that you have added within the activity?

    Button btnnext = (Button)findViewById(R.id.myNewButton);
    

    If you don’t do this and set a listener it will throw the nullpointer error.

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

Sidebar

Related Questions

Not sure what happened here, I added some new code and now I'm getting
EDIT : Accepted answer points out what my issue was. I added another answer
I've just added yet another 3rd-party component to my .net project that contains a
I added a new file F1 and made changes to another file F2 but
So in my main activity I added an image button and it works fine.
My GWT app is being added to an iframe. I have a button in
My facebook javascript that I added to uses the like button from facebook and
I created a WCF service and to the default service I added another operation
I generated a new form using sean-gen (seam new-form) and added another field to
I'm using Nunit for unit testing, and added another project called Unit Testing to

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.