您好每一个我想从共享偏好文件中设置的文本串在我的片段布局文本视图,但是当我试图从共享偏好文件数据,并把它串和串由一组文本到文本视图我所面临的问题空像值指针i红粉他是空怎能ID是什么?
fragment.Java
fragment.xml之
和
logcat的错误
View view = inflater.inflate(R.layout.fragment_home, container,false)
您在fragment_profile强似fragment_home。
只要改变它fragment_profile:
View view = inflater.inflate(R.layout.fragment_profile, container,false)
在ProfileFragment.java R.layout.fragment_home
更换你R.layout.fragment_profile
错误原因:
您在fragment_home
膨胀ProfileFragment.java
XML布局,并试图从textview
访问fragment_profile
部件