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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:28:52+00:00 2026-06-10T22:28:52+00:00

I’m having a strange issue with my application running on a Nexus 7 tablet.

  • 0

I’m having a strange issue with my application running on a Nexus 7 tablet.
I have two fragments that load data with CursorLoader from my custom ContentProvider.

When i startup the application it runs fine both in landscape and portait mode, loaders load data properly. The problem occurs when i rotate the screen: my Activity and both Fragments are correctly recreated and loaders are started again, as expected. They load data (debugging i saw that onLoadFinished is called for both loaders) but after that the application is FC with this exception:

08-30 13:10:03.310: E/AndroidRuntime(14964): FATAL EXCEPTION: ModernAsyncTask #4
08-30 13:10:03.310: E/AndroidRuntime(14964): java.lang.RuntimeException: An error occured while executing doInBackground()
08-30 13:10:03.310: E/AndroidRuntime(14964):    at android.support.v4.content.ModernAsyncTask$3.done(Unknown Source)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at java.lang.Thread.run(Thread.java:856)
08-30 13:10:03.310: E/AndroidRuntime(14964): Caused by: java.lang.NullPointerException
08-30 13:10:03.310: E/AndroidRuntime(14964):    at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1094)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at android.content.ContentResolver.query(ContentResolver.java:354)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at android.content.ContentResolver.query(ContentResolver.java:313)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at android.support.v4.content.CursorLoader.loadInBackground(Unknown Source)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at android.support.v4.content.CursorLoader.loadInBackground(Unknown Source)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(Unknown Source)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(Unknown Source)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(Unknown Source)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at android.support.v4.content.ModernAsyncTask$2.call(Unknown Source)
08-30 13:10:03.310: E/AndroidRuntime(14964):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-30 13:10:03.310: E/AndroidRuntime(14964):    ... 4 more

Honestly, stacktrace doesn’t help because it doesn’t contains any reference to my code and also it’s a pretty strange issue because, as a said above, both fragments work the first time i launch the application, work properly on the phone layout but crash on my tablet layout after screen rotation.

EDIT:

In both fragments i load data in the method onActivityCreated method simply calling getLoaderManager.initLoader(….);

This is how i created my loaders:

First fragment

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {

    CursorLoader cursorLoader = new CursorLoader(getActivity(), MyContract.CONTENT_URI,
            null, null, null, null);

    return cursorLoader;
}

second fragment:

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {

    return new CursorLoader(getActivity(), MyContract.CONTENT_URI, null,
            null, null, null);
}

This is the declaration of my CP’s content uri:

//MyContract class
public static final Uri CONTENT_URI = Uri.parse("content://" + MyProvider.AUTHORITY + "/items");

//In MyProvider class
public static final String AUTHORITY = "it.rciovati.mypackage.MyProvider"
  • 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-10T22:28:53+00:00Added an answer on June 10, 2026 at 10:28 pm

    I solved it.
    In my layout i have a third fragment that loads other data and there was a wrong check on it.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
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
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.