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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:12:26+00:00 2026-06-11T15:12:26+00:00

I’ve successfully setup an ActionBar using ActionBarSherlock and it sets intents to start when

  • 0

I’ve successfully setup an ActionBar using ActionBarSherlock and it sets intents to start when I select an option on it.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.menu_collection:
            startActivity(new Intent(this, Collection.class));
            return true;
        case R.id.menu_wishlist:
            startActivity(new Intent(this, Wishlist.class));
            return true;
    }

    return super.onOptionsItemSelected(item);
}

The problem is that when this intent is supposed to start I get this error:

09-10 20:30:15.496: E/AndroidRuntime(334): FATAL EXCEPTION: main
09-10 20:30:15.496: E/AndroidRuntime(334): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mypackage.thing/com.mypackage.thing.Wishlist}: java.lang.ClassCastException: com.mypackage.thing.Wishlist
09-10 20:30:15.496: E/AndroidRuntime(334):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
09-10 20:30:15.496: E/AndroidRuntime(334):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
09-10 20:30:15.496: E/AndroidRuntime(334):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
09-10 20:30:15.496: E/AndroidRuntime(334):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
09-10 20:30:15.496: E/AndroidRuntime(334):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-10 20:30:15.496: E/AndroidRuntime(334):  at android.os.Looper.loop(Looper.java:123)
09-10 20:30:15.496: E/AndroidRuntime(334):  at android.app.ActivityThread.main(ActivityThread.java:3683)
09-10 20:30:15.496: E/AndroidRuntime(334):  at java.lang.reflect.Method.invokeNative(Native Method)
09-10 20:30:15.496: E/AndroidRuntime(334):  at java.lang.reflect.Method.invoke(Method.java:507)
09-10 20:30:15.496: E/AndroidRuntime(334):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-10 20:30:15.496: E/AndroidRuntime(334):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-10 20:30:15.496: E/AndroidRuntime(334):  at dalvik.system.NativeStart.main(Native Method)
09-10 20:30:15.496: E/AndroidRuntime(334): Caused by: java.lang.ClassCastException: com.mypackage.thing.Wishlist
09-10 20:30:15.496: E/AndroidRuntime(334):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
09-10 20:30:15.496: E/AndroidRuntime(334):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
09-10 20:30:15.496: E/AndroidRuntime(334):  ... 11 more

Is something wrong with the class that’s supposed to initiate or in the xml files? i’m using the support package along with ActionBarSherlock. I’ve tried checking the manifest and layouts but nothing seems to be wrong there. Also I’m very new to fragments so not sure if thats set up correctly. The class that’s supposed to start has:

   ...
   import com.actionbarsherlock.app.SherlockListFragment;
   import com.mypackage.thing.contentprovider.DatabaseProvider;
   import com.mypackage.thing.database.WishlistTable;

   public class Wishlist extends SherlockListFragment
                implements LoaderManager.LoaderCallbacks<Cursor> {

   ...

   //Inflate ListFragment view
   @Override
   public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      return inflater.inflate(R.layout.wishlist, container, false);
   }

   ...

The class is then set up to use a cursorLoader and a provider/cursorAdapter to populate a list from SQLite.

  • 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-11T15:12:27+00:00Added an answer on June 11, 2026 at 3:12 pm

    Your WishList class extends SherlockListFragment. This is not an Activity class (see ListFragment.

    To put this in an Activity, you must create a new FragmentActivity (or rather, SherlockFragmentActivity) that hosts this fragment. This documentation may help you.

    • 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
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Specifically, suppose I start with the string string =hello \'i am \' me And
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to select an H1 element which is the second-child in its group

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.