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?