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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:39:42+00:00 2026-06-03T10:39:42+00:00

I have created one activity And I write some functions inside onCreate() function. On

  • 0

I have created one activity And I write some functions inside onCreate() function.
On Running the application , I got some error message Unable to start activity java.lang.nullpointerexception . And I have included this activity in AndroidManifest.xml

@Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.user_report_hr_full);
         List<Employee> data = new ArrayList<Employee>();
            Employee eg=new Employee();
            ListView li=(ListView)findViewById(R.id.user_report_hr_list);
            Intent myIntent = getIntent(); // this is just for example purpose
            Bundle b=myIntent.getExtras();
            Log.i("User Report by Hours", b.toString());
            Toast.makeText(getApplicationContext(), "User ", Toast.LENGTH_LONG).show();
            if(b !=null)
            {
                String username = b.getString("username");
                String userid = b.getString("userid");
                String startdate = b.getString("startdate");
                String enddate = b.getString("enddate");
                String mode=b.getString("mode");
                Log.i("LOOP", userid+"-"+startdate+"-"+enddate+"-"+mode);
                data=eg.getReports(username, userid, startdate, enddate,mode);
                Log.i("Get Report",data.toString());
                li.setAdapter(new UserHoursByReportArrayadapter(getApplicationContext(),data));
            }


    }

And My Log file is

05-08 11:45:30.745: I/User Report by HoursActivity:mode(517): 1
05-08 11:45:30.837: I/User Report by Hours(517): Bundle[mParcelledData.dataSize=236]
05-08 11:45:30.845: I/LOOP(517): 1-2012-04-08-2012-05-08-1
05-08 11:45:30.855: D/HTTP(517): Execute HTTP Post Request
05-08 11:45:30.855: D/UserID(517): Userid in EmpGlobal [1]
05-08 11:45:30.855: D/Start date(517): Start date in EmpGlobal [2012-04-08]
05-08 11:45:30.855: D/End date(517): End date in EmpGlobal [2012-05-08]
05-08 11:45:30.855: D/Mode(517): Mode in EmpGlobal [1]
05-08 11:45:48.275: I/log_tag(517):  Time: 2033755
05-08 11:45:48.275: I/log_tag(517):  project name: AndroidTimesheet
05-08 11:45:48.285: I/log_tag(517):  username: admin1
05-08 11:45:48.285: I/log_tag(517):  Time: 34692
05-08 11:45:48.285: I/log_tag(517):  project name: Google
05-08 11:45:48.285: I/log_tag(517):  username: admin1
05-08 11:45:48.285: I/Get Report(517): [com.technogems.employeetimecard.EmployeeGlobal@44da2ca8, com.technogems.employeetimecard.EmployeeGlobal@44da2f88]
05-08 11:45:48.285: I/User Report by HoursAdapter(517): Inside constructor
05-08 11:45:48.285: D/AndroidRuntime(517): Shutting down VM
05-08 11:45:48.285: W/dalvikvm(517): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
05-08 11:45:48.285: E/AndroidRuntime(517): Uncaught handler: thread main exiting due to uncaught exception
05-08 11:45:48.295: E/AndroidRuntime(517): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.technogems.employeetimecard/com.technogems.employeetimecard.UserHoursByReport}: java.lang.NullPointerException
05-08 11:45:48.295: E/AndroidRuntime(517):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
05-08 11:45:48.295: E/AndroidRuntime(517):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
05-08 11:45:48.295: E/AndroidRuntime(517):  at android.app.ActivityThread.access$2200(ActivityThread.java:119)
05-08 11:45:48.295: E/AndroidRuntime(517):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
05-08 11:45:48.295: E/AndroidRuntime(517):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-08 11:45:48.295: E/AndroidRuntime(517):  at android.os.Looper.loop(Looper.java:123)
05-08 11:45:48.295: E/AndroidRuntime(517):  at android.app.ActivityThread.main(ActivityThread.java:4363)
05-08 11:45:48.295: E/AndroidRuntime(517):  at java.lang.reflect.Method.invokeNative(Native Method)
05-08 11:45:48.295: E/AndroidRuntime(517):  at java.lang.reflect.Method.invoke(Method.java:521)
05-08 11:45:48.295: E/AndroidRuntime(517):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-08 11:45:48.295: E/AndroidRuntime(517):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-08 11:45:48.295: E/AndroidRuntime(517):  at dalvik.system.NativeStart.main(Native Method)
05-08 11:45:48.295: E/AndroidRuntime(517): Caused by: java.lang.NullPointerException
05-08 11:45:48.295: E/AndroidRuntime(517):  at com.technogems.employeetimecard.UserHoursByReport.onCreate(UserHoursByReport.java:35)
05-08 11:45:48.295: E/AndroidRuntime(517):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-08 11:45:48.295: E/AndroidRuntime(517):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
05-08 11:45:48.295: E/AndroidRuntime(517):  ... 11 more

Please provide me the proper way to start that activity

  • 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-03T10:39:44+00:00Added an answer on June 3, 2026 at 10:39 am

    Remove this line :
    Log.i(“User Report by Hours”, b.toString());
    Where b is null So the nullpointerException occured

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

Sidebar

Related Questions

I have created one activity i.e loginpage. it contains some edit textboxes, when I
I am developing an android application. Now i have created one function which create
I am trying to display ListView . I have created one activity , in
I have created one preference page where there are stringfieldeditor. Whenever user give some
I have created one application in flex that is accessing the Java webservice using
I have created one dynamic button in my application and I call the following
I have created one Catalyst application and I have created Schema and Model using
Dear friends, I have created one music app. It contains some collection of albums,
I have created one listview, in this each row contain check box and the
I have created one table using the below command: create table Table1( Id int

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.