2013-06-05 51 views
0

我有一個滑動菜單的類。 當我在我的活動中恢復時,當應用程序暫停時,出現以下錯誤!

android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment kostas.menu.rssreader.ListActivity$SampleListFragment: make sure class name exists, is public, and has an empty constructor that is public 

回答

0

請注意錯誤消息你得

06-05 16:27:04.215:E/AndroidRuntime(14976):java.lang.InstantiationException:由造成無法實例類kostas.menu.rssreader.ListActivity $ SampleListFragment;沒有空的構造

這有點意味着你HAVE有你創建的每個Fragment類一個空的構造。

只需添加空的構造函數,一切都應該很好。

+0

你的意思是'公共ListActivity(){}'?這會返回相同的錯誤 –

+0

否否否,'Fragment'需要一個空的構造函數。添加'公共SampleListFragment(){};' – thepoosh

+1

我已經嘗試了他們兩個,不幸的是遺留下來的錯誤.. –

相關問題