0
这里是我的片段哪里得到片段中的内容?
public class Top_Tab1 extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v =inflater.inflate(R.layout.top_tab_1,container,false);
Typeface type_thin = Typeface.createFromAsset(getAssets(),"fonts/Roboto-Thin.ttf");
return v;
}
getAssets()让我一个错误:无法解析方法。我想我需要一个内容。我在哪里可以得到它?
这是让我这个:致命例外:主 java.lang.RuntimeException:无法实例化活动ComponentInfo {com.example.myapplication/com.example.myapplication.MainActivity}:java.lang.ClassNotFoundException:没有找到类的“com.example.myapplication.MainActivity”路径:DexPathList [[],nativeLibraryDirectories = [/ vendor/lib,/ system/lib]] – Zhambulable 2015-03-30 21:28:05
您可能必须将其移动到onActivityCreated(Bundle bundle)奇怪的。你如何创建片段? – 2015-03-30 21:33:33
现在它工作正常,Thanx – Zhambulable 2015-03-30 21:36:11