2013-06-05 50 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

我已经尝试了他们两个,不幸的是遗留下来的错误.. –

相关问题