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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:59:59+00:00 2026-05-30T05:59:59+00:00

I have a home page activity that I got from an example, which works

  • 0

I have a home page activity that I got from an example, which works fine. Now I am trying to make it have a button that makes the app go to the next screen.

So I added a second activity to the application manifest:

<activity
    android:name=".AddProblemActivity"
    android:label="@string/app_name" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>        

But I wonder if it is supposed to have these two lines:

    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />

It seems that MAIN is saying that there should be a main() function. But isn’t that only supposed to exist on the home page?

Here is the full stack trace:

02-20 10:17:04.408: D/gralloc_goldfish(646): Emulator without GPU emulation detected.
02-20 10:18:58.655: D/AndroidRuntime(646): Shutting down VM
02-20 10:18:58.665: W/dalvikvm(646): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
02-20 10:18:58.745: E/AndroidRuntime(646): FATAL EXCEPTION: main
02-20 10:18:58.745: E/AndroidRuntime(646): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.problemio/com.problemio.AddProblemActivity}: java.lang.NullPointerException
02-20 10:18:58.745: E/AndroidRuntime(646):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
02-20 10:18:58.745: E/AndroidRuntime(646):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-20 10:18:58.745: E/AndroidRuntime(646):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-20 10:18:58.745: E/AndroidRuntime(646):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-20 10:18:58.745: E/AndroidRuntime(646):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-20 10:18:58.745: E/AndroidRuntime(646):  at android.os.Looper.loop(Looper.java:137)
02-20 10:18:58.745: E/AndroidRuntime(646):  at android.app.ActivityThread.main(ActivityThread.java:4424)
02-20 10:18:58.745: E/AndroidRuntime(646):  at java.lang.reflect.Method.invokeNative(Native Method)
02-20 10:18:58.745: E/AndroidRuntime(646):  at java.lang.reflect.Method.invoke(Method.java:511)
02-20 10:18:58.745: E/AndroidRuntime(646):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-20 10:18:58.745: E/AndroidRuntime(646):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-20 10:18:58.745: E/AndroidRuntime(646):  at dalvik.system.NativeStart.main(Native Method)
02-20 10:18:58.745: E/AndroidRuntime(646): Caused by: java.lang.NullPointerException
02-20 10:18:58.745: E/AndroidRuntime(646):  at com.problemio.AddProblemActivity.onCreate(AddProblemActivity.java:28)
02-20 10:18:58.745: E/AndroidRuntime(646):  at android.app.Activity.performCreate(Activity.java:4465)
02-20 10:18:58.745: E/AndroidRuntime(646):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
02-20 10:18:58.745: E/AndroidRuntime(646):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
02-20 10:18:58.745: E/AndroidRuntime(646):  ... 11 more

This is the part of my onCreate from AddProblemActivity causes the error it seems:

    final EditText problemName = (EditText) findViewById(R.id.problem_name);  
    String name = problemName.getText().toString(); // THIS LINE  

Here is my xml for is problem_name from the Layout xml:

    <EditText  
        android:id="@+id/problem_name"  
        android:layout_height="wrap_content"  
        android:hint="@string/problem_name"  
        android:inputType="textPersonName"  
        android:layout_width="fill_parent">  
    </EditText>  

Thanks,
Alex

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

    The variable problemName is probably null. Check if it is and make sure that you have done setContentView with a layout that contains such an id.
    If you do you could also try to clean the build environment if you use an IDE such as Eclipse or IntelliJ IDEA since they sometimes keep old generated R files.

    You should not have this intent filter unless you want the second activity to show up on the home screen.

    <activity
    android:name=".AddProblemActivity"
    android:label="@string/app_name" />
    

    will do if you just want to be able to start the second activity (AddProblemActivity) from the first.

    Have a look at http://developer.android.com/guide/topics/intents/intents-filters.html to learn about Intents and Intent filters.

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

Sidebar

Related Questions

in my android app, I have a button that leads to an activity which
I have a WordPress site (2.6.2) in which I have set the Home page
I have an iPhone WebApp that is installed to the home page. When a
I have a simple link in a menu <a id=Home href=Amico-Bio-Home-Page></a> to which i
I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
I have a home page with a search box and a button on it.
I have a home page on which, inside an IFrame a different HTML page
I want to make android home page background. I have imported a video file
my home page is a tabbarView,now ,I have a presentModalView Controller,and as we know
I have an ASP.NET home page where user provides his login ID. Depending on

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.