我有一個intent
的問題,它擴展了Fragment
,它來自一個擴展了Activity
的類。如何從擴展Activity的類開始擴展片段的意圖?
TabBar2.class - >擴展活動
Favourite.class - >擴展片段
這是我寫我的意圖。
Intent intent1 = new Intent(TabBar2.this, Favourite.class);
startActivity(intent1);
但我的應用程序崩潰時,我運行的意圖onClick
。 我的logCat說
Unable to instantiate activity
ComponentInfo{com.honey.test/com.honey.test.Favourite}:
java.lang.ClassCastException: com.honey.test.Favourite
我做錯了什麼?有人可以指導我如何解決這個問題嗎?
檢查THI一個'HTTP:// stackoverflow.com /問題/ 9831728 /啓動一個片段的通路意向中之fragment' – Steve