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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:26:32+00:00 2026-06-13T14:26:32+00:00

I have problem starting an intent that extends Fragment , from a class that

  • 0

I have problem starting an intent that extends Fragment, from a class that extends Activity.

TabBar2.class –> extends Activity

Favourite.class –> extends Fragment

This is how I write my intent.

Intent intent1 = new Intent(TabBar2.this, Favourite.class);
startActivity(intent1);

But my app crashes when I run the intent when onClick.
My logCat says

Unable to instantiate activity
 ComponentInfo{com.honey.test/com.honey.test.Favourite}:
 java.lang.ClassCastException: com.honey.test.Favourite

What did I do wrong? Can someone guide me on how to solve this?

  • 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-13T14:26:33+00:00Added an answer on June 13, 2026 at 2:26 pm

    It is because you can’t call Fragments via Intent, Fragment is a part of an FragmentActivity

    All in all Fragment is a content not container, so you need to create a FragmentActivity and add Fragment(Favourite) in that, and then call

    Intent intent1 = new Intent(TabBar2.this, SomeFragmentActivity.class);
    startActivity(intent1);
    

    A Fragment is a piece of an application's user interface or behavior that can be placed in an Activity more information

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

Sidebar

Related Questions

Starting from Android 3.2 I have this strange problem. It's very easy to reproduce:
I have odd problem: After starting server I got this error: undefined local variable
I'm having a problem with my activity intent launcher. It seems that when I
I have a problem with my app. When starting a the FusRoDAHnomusic activity, it
This is a pretty strange problem. I have a book that I have been
I have a strange problem in my android application. I am starting one activity
I have a problem with starting the sunspot server. last week it worked like
I am just starting out with JNI and I have a following problem. I
I am just starting working with jquery and have encountered the following problem <div
I have problem with my query on C, I’m using the oci8 driver. This

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.