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

  • Home
  • SEARCH
  • 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 8112341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:27:54+00:00 2026-06-06T02:27:54+00:00

I have the following own Interface Implementation in my Fragment: @Override public void onReportChanged(Fragment

  • 0

I have the following own Interface Implementation in my Fragment:

@Override
    public void onReportChanged(Fragment sender, long id, int position) {
        // Views ein und ausblenden
        _List.setVisibility(View.GONE);
        _OnLoading.setVisibility(View.VISIBLE);
        _NoDataView.setVisibility(View.GONE);
        _ReportId = id;
        getLoaderManager().restartLoader(_LM_REPORTS, null, this);
    };

The FragmentActivity report to this Fragment, that another Fragment (Selection List) have selected one item. After that the ListFragment should load new Data with reported ID (_ReportId).

But I get NullPoinerException on this code before going to onCreateLoader-Method. Here is the LogCat:

05-28 14:24:37.905: E/AndroidRuntime(1775): FATAL EXCEPTION: main
05-28 14:24:37.905: E/AndroidRuntime(1775): java.lang.NullPointerException
05-28 14:24:37.905: E/AndroidRuntime(1775):     at android.support.v4.app.LoaderManagerImpl.restartLoader(LoaderManager.java:637)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at de.webducer.android.worktime.beta.ui.fragment.ReportListFragment.onReportChanged(ReportListFra gment.java:142)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at de.webducer.android.worktime.beta.ui.ReportListActivity.onReportSelected(ReportListActivity.java:97)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at de.webducer.android.worktime.beta.ui.fragment.ReportSelectorSpinnerFragment$1.onItemSelected(ReportSelectorSpinnerFragment.java:78)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at android.widget.AdapterView.fireOnSelected(AdapterView.java:882)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at android.widget.AdapterView.access$200(AdapterView.java:48)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:848)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at android.os.Handler.handleCallback(Handler.java:605)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at android.os.Handler.dispatchMessage(Handler.java:92)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at android.os.Looper.loop(Looper.java:137)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at android.app.ActivityThread.main(ActivityThread.java:4424)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at java.lang.reflect.Method.invokeNative(Native Method)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at java.lang.reflect.Method.invoke(Method.java:511)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-28 14:24:37.905: E/AndroidRuntime(1775):     at dalvik.system.NativeStart.main(Native Method)

I don’T understand why. The same code (but for the other list) works fine on the other FragmentActivity.

  • 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-06T02:27:59+00:00Added an answer on June 6, 2026 at 2:27 am

    I found the reason:

    @Override
    public Loader<Cursor> onCreateLoader(int id, Bundle extra) {
        CursorLoader returnValue = null;
        if (_ReportId > 0) {
            switch (id) {
                case _LM_REPORTS:
                    returnValue = new CursorLoader(getActivity(),
                        ReportContentProvider.CONTENT_URI_REPORT_DATA,
                        null,
                        ReportTable.COLUMN_ID + " =?",
                        new String[] { String.valueOf(_ReportId) },
                        null);
                        break;
    
                    default:
                        break;
                }
            }
        return returnValue;
    }
    

    The Loader have allways to run. The condition if (_ReportId > 1) produced the exception. Without the condition the code runs fine.

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

Sidebar

Related Questions

If I have the following Interface structure; public interface IPaymentTypeBase { void PayNow(); double
I want to do the following: The user should have his own sub site
I have following plist: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
I have a RPC service with the following method: public List<Serializable> myMethod(TransactionCall call) {...}
Let's take a glance at the following code in Java. interface FirstInaterface { public
I am trying to build a treemap, and have implemented my own Comparable interface
The Background I have the following source code #include <libubuntuone-1.0/u1-music-store.h> #include <libsyncdaemon-1.0/libsyncdaemon/libsyncdaemon.h> static void
I have written my own java.util.List implementation, and now i want to store it
I would like to make my own user-mode NAT application. I have the folowing
I have following source. In insertMessage(..), it calls selectMessage to check whether duplicate record

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.