preferencefragment no view found for id android

雨燕双飞 提交于 2019-12-04 03:03:41
william pagnon

The official documentation is misleading:

Removing the onCreate function in public class EditPreferences extends PreferenceActivity resolves the issue.

I just moved what was in onCreate to onBuildHeaders function.

I was having this problem too, until I realized that I had specified the wrong layout in setContentView() of the onCreate() method of the FragmentActivity.

The id passed into FragmentTransaction.add(), in your case R.id.feedContentContainer, must be a child of the layout specified in setContentView().

You didn't show us your onCreate() method, so perhaps this is the same problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!