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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:05:12+00:00 2026-06-04T09:05:12+00:00

I’m using the Android compatibility library, targeting Android 2.2. If I use ListFragment With

  • 0

I’m using the Android compatibility library, targeting Android 2.2. If I use ListFragment With an array adapter, it works fine, but if I use a simpleCursorAdapter, it crashes. Here is the code I have for my ListFragment:

public class Fragment1 extends ListFragment {

    private SQLiteDatabase db;
    private Cursor c;

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
      super.onActivityCreated(savedInstanceState);
      DbManager dbm = new DbManager (getActivity(), "mainDb", null, 3);
      db = dbm.getWritableDatabase();
      c = db.rawQuery("SELECT * FROM navegacion", null);
      c.moveToFirst();

      ListAdapter adapter = new SimpleCursorAdapter( getActivity().getApplicationContext(), R.layout.list_item, c, new String[]{"texto"}, new int []{R.id.mainListText}, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);
      setListAdapter(adapter);


    }
 }

DbManager is a class that extends SqliteHelper. I don’t get why it doesn’t work. It used to work with listActivity. I even added the flag to the constructor. When I instantiate this fragment, the device says that the aplication has been interrupted and closes it. Does someone know what I’m doing wrong?

Thank you in Advance.


Edit. Here is the stacktrace from logcat:

05-22 19:32:17.093: W/dalvikvm(12680): VFY: unable to resolve virtual method 4091: Lcom/actionbarsherlock/internal/nineoldandroids/widget/NineFrameLayout;.onHoverEvent (Landroid/view/MotionEvent;)Z
05-22 19:32:17.103: W/dalvikvm(12680): VFY: unable to resolve virtual method 2878: Landroid/widget/FrameLayout;.getAlpha ()F
05-22 19:32:17.103: W/dalvikvm(12680): VFY: unable to resolve virtual method 2879: Landroid/widget/FrameLayout;.getTranslationY ()F
05-22 19:32:17.103: W/dalvikvm(12680): VFY: unable to resolve virtual method 2882: Landroid/widget/FrameLayout;.setAlpha (F)V
05-22 19:32:17.103: W/dalvikvm(12680): VFY: unable to resolve virtual method 2890: Landroid/widget/FrameLayout;.setTranslationY (F)V
05-22 19:32:17.123: W/dalvikvm(12680): VFY: unable to resolve virtual method 257: Landroid/content/pm/PackageManager;.getActivityLogo (Landroid/content/ComponentName;)Landroid/graphics/drawable/Drawable;
05-22 19:32:17.123: W/dalvikvm(12680): VFY: unable to resolve virtual method 254: Landroid/content/pm/ApplicationInfo;.loadLogo (Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;
05-22 19:32:17.173: W/dalvikvm(12680): VFY: unable to resolve virtual method 2660: Landroid/view/ViewGroup;.getAlpha ()F
05-22 19:32:17.173: W/dalvikvm(12680): VFY: unable to resolve virtual method 2666: Landroid/view/ViewGroup;.getTranslationX ()F
05-22 19:32:17.173: W/dalvikvm(12680): VFY: unable to resolve virtual method 2667: Landroid/view/ViewGroup;.getTranslationY ()F
05-22 19:32:17.173: W/dalvikvm(12680): VFY: unable to resolve virtual method 2682: Landroid/view/ViewGroup;.setAlpha (F)V
05-22 19:32:17.173: W/dalvikvm(12680): VFY: unable to resolve virtual method 2686: Landroid/view/ViewGroup;.setTranslationX (F)V
05-22 19:32:17.173: W/dalvikvm(12680): VFY: unable to resolve virtual method 2687: Landroid/view/ViewGroup;.setTranslationY (F)V
05-22 19:32:17.183: W/dalvikvm(12680): VFY: unable to resolve virtual method 5020: Lcom/actionbarsherlock/internal/widget/ActionBarView$HomeView;.onHoverEvent (Landroid/view/MotionEvent;)Z
05-22 19:32:17.183: W/dalvikvm(12680): VFY: unable to resolve virtual method 2881: Landroid/widget/FrameLayout;.onPopulateAccessibilityEvent (Landroid/view/accessibility/AccessibilityEvent;)V
05-22 19:32:17.223: W/dalvikvm(12680): VFY: unable to resolve virtual method 2893: Landroid/widget/HorizontalScrollView;.getAlpha ()F
05-22 19:32:17.223: W/dalvikvm(12680): VFY: unable to resolve virtual method 2894: Landroid/widget/HorizontalScrollView;.setAlpha (F)V
05-22 19:32:17.223: W/dalvikvm(12680): VFY: unable to resolve direct method 2924: Landroid/widget/LinearLayout;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;I)V
05-22 19:32:17.223: W/dalvikvm(12680): VFY: unable to resolve virtual method 2928: Landroid/widget/LinearLayout;.getAlpha ()F
05-22 19:32:17.223: W/dalvikvm(12680): VFY: unable to resolve virtual method 2931: Landroid/widget/LinearLayout;.getTranslationX ()F
05-22 19:32:17.223: W/dalvikvm(12680): VFY: unable to resolve virtual method 2938: Landroid/widget/LinearLayout;.setAlpha (F)V
05-22 19:32:17.223: W/dalvikvm(12680): VFY: unable to resolve virtual method 2944: Landroid/widget/LinearLayout;.setTranslationX (F)V
05-22 19:32:17.243: W/dalvikvm(12680): VFY: unable to resolve static field 2657 (ROOT) in Ljava/util/Locale;
05-22 19:32:17.303: W/dalvikvm(12680): VFY: unable to resolve virtual method 2592: Landroid/view/View;.jumpDrawablesToCurrentState ()V
05-22 19:32:21.583: W/dalvikvm(12680): threadid=1: thread exiting with uncaught exception (group=0x40020ac0)
05-22 19:32:21.593: E/AndroidRuntime(12680): FATAL EXCEPTION: main
05-22 19:32:21.593: E/AndroidRuntime(12680): java.lang.IllegalArgumentException: column '_id' does not exist
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:314)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.support.v4.widget.CursorAdapter.init(CursorAdapter.java:174)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.support.v4.widget.CursorAdapter.<init>(CursorAdapter.java:151)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.support.v4.widget.ResourceCursorAdapter.<init>(ResourceCursorAdapter.java:93)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.support.v4.widget.SimpleCursorAdapter.<init>(SimpleCursorAdapter.java:89)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at com.kinbit.abTest.Fragment1.onActivityCreated(Fragment1.java:66)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:891)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1080)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:622)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1416)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:420)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.os.Handler.handleCallback(Handler.java:587)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.os.Handler.dispatchMessage(Handler.java:92)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.os.Looper.loop(Looper.java:123)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at android.app.ActivityThread.main(ActivityThread.java:4627)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at java.lang.reflect.Method.invokeNative(Native Method)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at java.lang.reflect.Method.invoke(Method.java:521)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-22 19:32:21.593: E/AndroidRuntime(12680):    at dalvik.system.NativeStart.main(Native Method)
  • 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-04T09:05:13+00:00Added an answer on June 4, 2026 at 9:05 am

    The reason why it is working with ArrayAdapter but not with SimpleCursorAdapter is because SimpleCursorAdapter extends CursorAdapter, and CursorAdapter will not work if your cursor does not contain a column named _id. The values in the _id column should be the values that are bound to the ListView.

    This error has nothing to do with the compatability library.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.