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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:10:03+00:00 2026-06-10T12:10:03+00:00

I’m developing an app with a ContentProvider to offer some inner files (binary files).

  • 0

I’m developing an app with a ContentProvider to offer some inner files (binary files). When I deploy it on a Samsung Galaxy S, SII, or any other, it works perfectly, buy when I try it on a Galaxy Nexus or Nexus S, it doesn’t work!

Scenario:

My ContentProvider can be accessed with two URIs. Depending on this URI, the provider creates a DataCursor (extending CrossProcessCursor) or ModelCursor (extending CrossProcessCursos also). The fact is that, in Nexus family, I access the first cursor (DataCursor) to retrieve an identifier, and it works perfectly, but when accessing the second one, it always throws “OutOfBoundsException” when trying

getBlob()

method.

Provider

@Override
    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
        Cursor cursor = null;

        // If the third app requieres DATA (phrase id, phrase string and phrase name)
        if(uri.toString().equalsIgnoreCase(ProviderConstants.DATA_URI.toString())) {
            // Build the DataHelper and the customized cursor
            DataHelper dataHelper = new DataHelper(getContext());
            cursor = new DataCursor(dataHelper);
        } else if(uri.toString().equalsIgnoreCase(ProviderConstants.MODEL_URI.toString())) {            
            // Let's take the model id from the selectionArgs...
            if (selectionArgs != null && selectionArgs.length > 0) {
                String modelId = selectionArgs[0];

                // Get an instance to the persistent storage service...
                File file = FileManager.getDirectory(getContext(), modelId);
                FileSystemPersistentStorageService clientPersistentStorageService = new FileSystemPersistentStorageService(file);

                cursor = new ModelCursor(clientPersistentStorageService);
            } else {
                Log.e("ContentProvider", "Query without model id on selectionArgs");
            }
        }

        return cursor;
    }

If you need some code or anything, just ask for it please!

Thanks a lot.

  • 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-10T12:10:04+00:00Added an answer on June 10, 2026 at 12:10 pm

    Finally I got the answer. It wasn’t due to devices, but it was due to Android OS version.

    Earlier versions from 4.0.3 had the method fillWindow() of AbstarctCursor implemented one way, being not mandatory to set the cursor position to 0 for first item. After 4.0.3 (as seen here), this method was modified, resulting on not setting the cursor position to 0.

    The Exception thrown was:

    07-31 11:35:09.938: W/System.err(2760): android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1
    07-31 11:35:09.985: W/System.err(2760):     at android.database.AbstractCursor.checkPosition(AbstractCursor.java:418)
    07-31 11:35:09.989: W/System.err(2760):     at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
    07-31 11:35:09.989: W/System.err(2760):     at android.database.AbstractWindowedCursor.getBlob(AbstractWindowedCursor.java:44)
    07-31 11:35:09.993: W/System.err(2760):     at android.database.CursorWrapper.getBlob(CursorWrapper.java:122)
    07-31 11:35:09.993: W/System.err(2760):     at es.agnitio.kivox.mobile.internal.ModelImporterAndroidImpl.importModelPackage(ModelImporterAndroidImpl.java:44)
    07-31 11:35:09.993: W/System.err(2760):     at es.agnitio.kivox.mobile.internal.KivoxMobileBasicCode.importModel(KivoxMobileBasicCode.java:159)
    07-31 11:35:09.997: W/System.err(2760):     at es.agnitio.kivox.mobile.internal.KivoxMobileBasicImpl.importModel(KivoxMobileBasicImpl.java:47)
    07-31 11:35:09.997: W/System.err(2760):     at es.agnitio.kivoxmobile.testing.KivoxMobileBasicTrial.onCreate(KivoxMobileBasicTrial.java:63)
    07-31 11:35:09.997: W/System.err(2760):     at android.app.Activity.performCreate(Activity.java:5008)
    07-31 11:35:10.001: W/System.err(2760):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
    07-31 11:35:10.001: W/System.err(2760):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
    07-31 11:35:10.001: W/System.err(2760):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
    07-31 11:35:10.004: W/System.err(2760):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
    07-31 11:35:10.004: W/System.err(2760):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
    07-31 11:35:10.004: W/System.err(2760):     at android.os.Handler.dispatchMessage(Handler.java:99)
    07-31 11:35:10.008: W/System.err(2760):     at android.os.Looper.loop(Looper.java:137)
    07-31 11:35:10.008: W/System.err(2760):     at android.app.ActivityThread.main(ActivityThread.java:4745)
    07-31 11:35:10.008: W/System.err(2760):     at java.lang.reflect.Method.invokeNative(Native Method)
    07-31 11:35:10.012: W/System.err(2760):     at java.lang.reflect.Method.invoke(Method.java:511)
    07-31 11:35:10.012: W/System.err(2760):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    07-31 11:35:10.012: W/System.err(2760):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    07-31 11:35:10.016: W/System.err(2760):     at dalvik.system.NativeStart.main(Native Method)
    

    Which shows (after deep research), that the cursor index is not being setted on fillWindow().

    SOLUTION

    To solve this “fragmentation” issue, just add moveToPosition(0) in methods like moveToFirst() or move() (with some app logic) of your custom cursor. This will make the cursor index to be setted to 0, avoiding the “-1” index request Exception.

    Hope it helps anybody =)

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I know there's a lot of other questions out there that deal with this
I have thousands of HTML files to process using Groovy/Java and I need to
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload

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.