本文整理了Java中androidx.fragment.app.Fragment.onCreateView()
方法的一些代码示例,展示了Fragment.onCreateView()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fragment.onCreateView()
方法的具体详情如下:
包路径:androidx.fragment.app.Fragment
类名称:Fragment
方法名:onCreateView
暂无
代码示例来源:origin: PhilJay/MPAndroidChart
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
tf = Typeface.createFromAsset(context.getAssets(), "OpenSans-Regular.ttf");
return super.onCreateView(inflater, container, savedInstanceState);
}
代码示例来源:origin: googlesamples/easypermissions
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
// Create view
View v = inflater.inflate(R.layout.fragment_main, container);
// Button click listener
v.findViewById(R.id.button_sms).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
smsTask();
}
});
return v;
}
代码示例来源:origin: googlesamples/easypermissions
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
getContext().getTheme().applyStyle(R.style.Theme_AppCompat, true);
return super.onCreateView(inflater, container, savedInstanceState);
}
代码示例来源:origin: contentful/gallery-app-android
@Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
return inflater.inflate(R.layout.fragment_slide, container, false);
}
代码示例来源:origin: contentful/gallery-app-android
@Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
return inflater.inflate(R.layout.fragment_gallery_info, container, false);
}
代码示例来源:origin: trello/navi
@Nullable @Override @CallSuper public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
base.onCreateView(savedInstanceState);
return super.onCreateView(inflater, container, savedInstanceState);
}
代码示例来源:origin: jaredsburrows/android-gradle-java-app-template
@NonNull
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
final View rootView = inflater.inflate(R.layout.fragment_main, container, false);
startInterstitial = rootView.findViewById(R.id.buttonStartInterstitial);
startInterstitial.setOnClickListener(onClickListener);
adView = rootView.findViewById(R.id.adView);
adView.setAdListener(adListener);
adView.loadAd(new AdRequest.Builder().build());
interstitialAd = new InterstitialAd(rootView.getContext());
interstitialAd.setAdUnitId(getString(R.string.app_ad_interstitial));
interstitialAd.setAdListener(adListener);
interstitialAd.loadAd(new AdRequest.Builder().build());
return rootView;
}
内容来源于网络,如有侵权,请联系作者删除!