android.app.Activity.onCreateView()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(680)

本文整理了Java中android.app.Activity.onCreateView()方法的一些代码示例,展示了Activity.onCreateView()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.onCreateView()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:onCreateView

Activity.onCreateView介绍

暂无

代码示例

代码示例来源:origin: chiuki/advanced-textview

@Override
public View onCreateView(View parent, String name, Context context, AttributeSet attrs) {
 //this would apply to all textviews in the app
 if (name.equals("TextView")) {
  TextView view = new TextView(this, attrs);
  view.setTypeface(typeface);
  return view;
 }
 return super.onCreateView(parent, name, context, attrs);
}

代码示例来源:origin: chiuki/advanced-textview

@Override
public View onCreateView(String name, Context context, AttributeSet attrs) {
 //this would apply to all textviews in the app
 if (name.equals("TextView")) {
  TextView view = new TextView(this, attrs);
  view.setTypeface(typeface);
  return view;
 }
 return super.onCreateView(name, context, attrs);
}

代码示例来源:origin: iqiyi/Neptune

@Override
public View callOnCreateView(String name, Context context, AttributeSet attrs) {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    if (null != mPlugin) {
      return mPlugin.onCreateView(name, context, attrs);
    } else if (null != mProxy) {
      return mProxy.onCreateView(name, context, attrs);
    }
  }
  return null;
}

代码示例来源:origin: iqiyi/Neptune

@Override
public View callOnCreateView(View parent, String name, Context context, AttributeSet attrs) {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    if (null != mPlugin) {
      return mPlugin.onCreateView(parent, name, context, attrs);
    } else if (null != mProxy) {
      return mProxy.onCreateView(parent, name, context, attrs);
    }
  }
  return null;
}

代码示例来源:origin: iqiyi/Neptune

@Override
public android.view.View onCreateView(android.view.View view0, java.lang.String string1, android.content.Context context2, android.util.AttributeSet attributeset3) {
  return mOriginActivity.onCreateView(view0, string1, context2, attributeset3);
}

代码示例来源:origin: iqiyi/Neptune

@Override
public android.view.View onCreateView(java.lang.String string0, android.content.Context context1, android.util.AttributeSet attributeset2) {
  return mOriginActivity.onCreateView(string0, context1, attributeset2);
}

代码示例来源:origin: com.uphyca/android-junit4-robolectric

/**
 * @param name
 * @param context
 * @param attrs
 * @return
 * @see android.app.Activity#onCreateView(java.lang.String,
 *      android.content.Context, android.util.AttributeSet)
 */
public View onCreateView(String name,
             Context context,
             AttributeSet attrs) {
  return mActivity.onCreateView(name, context, attrs);
}

代码示例来源:origin: com.uphyca/android-junit4-robolectric

/**
 * @param parent
 * @param name
 * @param context
 * @param attrs
 * @return
 * @see android.app.Activity#onCreateView(android.view.View,
 *      java.lang.String, android.content.Context,
 *      android.util.AttributeSet)
 */
public View onCreateView(View parent,
             String name,
             Context context,
             AttributeSet attrs) {
  return mActivity.onCreateView(parent, name, context, attrs);
}

代码示例来源:origin: kingargyle/adt-leanback-support

/**
 * Add support for inflating the <fragment> tag.
 */
@Override
public View onCreateView(String name, @NonNull Context context, @NonNull AttributeSet attrs) {
  if (!"fragment".equals(name)) {
    return super.onCreateView(name, context, attrs);
  }
  final View v = mFragments.onCreateView(name, context, attrs);
  if (v == null) {
    return super.onCreateView(name, context, attrs);
  }
  return v;
}

代码示例来源:origin: shazam/android-aspects

@Nullable
@Override
public View onCreateView(String name, Context context, AttributeSet attrs) {
  View view = super.onCreateView(name, context, attrs);
  return view != null ? view : dispatcher.dispatchOnCreateView(this, name, context, attrs);
}

代码示例来源:origin: shazam/android-aspects

@Override
public View onCreateView(View parent, String name, @NonNull Context context, @NonNull AttributeSet attrs) {
  View view = super.onCreateView(parent, name, context, attrs);
  return view != null ? view : dispatcher.dispatchOnCreateView(this, parent, name, context, attrs);
}

代码示例来源:origin: baidu/GPT

@Override
public View onCreateView(String name, Context context, AttributeSet attrs) {
  View view = null;
  if (mFactory != null) {
    view = mFactory.onCreateView(name, context, attrs);
    if (view != null) {
      return view;
    }
  }
  if (-1 != name.indexOf('.')) {
    // 非系统view、自己处理。
    try {
      view = createView(name, null, attrs);
    } catch (Exception e) {
      if (DEBUG) {
        e.printStackTrace();
      }
    }
  } else if ("fragment".equals(name)) {
    /*
     * 处理 fragment createview。
     * 因为我们自己在activity之前就set了layoutinflator,参考ActivityProxy.changeInflatorContext。
     * 导致FragmentActivity无法自己setFactory。所以我们需要接管他。
     */
    Activity activity = (Activity) context;
    view = activity.onCreateView(name, context, attrs);
  }
  return view;
}

代码示例来源:origin: iqiyi/Neptune

@Override
public View onCreateView(View parent, String name, Context context, AttributeSet attrs) {
  PluginDebugLog.runtimeLog(TAG, "InstrActivityProxy1 onCreateView2:" + name);
  if (getController() != null) {
    return getController().callOnCreateView(parent, name, context, attrs);
  }
  return super.onCreateView(parent, name, context, attrs);
}

代码示例来源:origin: iqiyi/Neptune

@Override
public View onCreateView(String name, Context context, AttributeSet attrs) {
  PluginDebugLog.runtimeLog(TAG, "InstrActivityProxy1 onCreateView1:" + name);
  if (getController() != null) {
    return getController().callOnCreateView(name, context, attrs);
  }
  return super.onCreateView(name, context, attrs);
}

代码示例来源:origin: com.google.android/support-v4

public View onCreateView(String name, Context context, AttributeSet attrs) {
  if (!"fragment".equals(name)) {
    return super.onCreateView(name, context, attrs);

代码示例来源:origin: ELynx/pokemon-go-xposed-mitm

public android.view.View onCreateView(java.lang.String name, android.content.Context context, android.util.AttributeSet attrs) {
 if (ScriptLoader.isCalledFromJRuby()) return super.onCreateView(name, context, attrs);
 if (!JRubyAdapter.isInitialized()) {
  Log.i("Method called before JRuby runtime was initialized: RubotoActivity#onCreateView");
  return super.onCreateView(name, context, attrs);
 }
 String rubyClassName = scriptInfo.getRubyClassName();
 if (rubyClassName == null) return super.onCreateView(name, context, attrs);
 if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onCreateView}")) {
  return (android.view.View) JRubyAdapter.runRubyMethod(android.view.View.class, scriptInfo.getRubyInstance(), "onCreateView", new Object[]{name, context, attrs});
 } else {
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_create_view}")) {
   return (android.view.View) JRubyAdapter.runRubyMethod(android.view.View.class, scriptInfo.getRubyInstance(), "on_create_view", new Object[]{name, context, attrs});
  } else {
   if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(true).any?{|m| m.to_sym == :on_create_view}")) {
    return (android.view.View) JRubyAdapter.runRubyMethod(android.view.View.class, scriptInfo.getRubyInstance(), "on_create_view", new Object[]{name, context, attrs});
   } else {
    return (android.view.View) JRubyAdapter.runRubyMethod(android.view.View.class, scriptInfo.getRubyInstance(), "onCreateView", new Object[]{name, context, attrs});
   }
  }
 }
}

代码示例来源:origin: ELynx/pokemon-go-xposed-mitm

public android.view.View onCreateView(android.view.View parent, java.lang.String name, android.content.Context context, android.util.AttributeSet attrs) {
 if (ScriptLoader.isCalledFromJRuby()) return super.onCreateView(parent, name, context, attrs);
 if (!JRubyAdapter.isInitialized()) {
  Log.i("Method called before JRuby runtime was initialized: RubotoActivity#onCreateView");
  return super.onCreateView(parent, name, context, attrs);
 }
 String rubyClassName = scriptInfo.getRubyClassName();
 if (rubyClassName == null) return super.onCreateView(parent, name, context, attrs);
 if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onCreateView}")) {
  return (android.view.View) JRubyAdapter.runRubyMethod(android.view.View.class, scriptInfo.getRubyInstance(), "onCreateView", new Object[]{parent, name, context, attrs});
 } else {
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_create_view}")) {
   return (android.view.View) JRubyAdapter.runRubyMethod(android.view.View.class, scriptInfo.getRubyInstance(), "on_create_view", new Object[]{parent, name, context, attrs});
  } else {
   if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(true).any?{|m| m.to_sym == :on_create_view}")) {
    return (android.view.View) JRubyAdapter.runRubyMethod(android.view.View.class, scriptInfo.getRubyInstance(), "on_create_view", new Object[]{parent, name, context, attrs});
   } else {
    return (android.view.View) JRubyAdapter.runRubyMethod(android.view.View.class, scriptInfo.getRubyInstance(), "onCreateView", new Object[]{parent, name, context, attrs});
   }
  }
 }
}

代码示例来源:origin: iAcn/BiliNeat

return super.onCreateView(name, context, attrs);

相关文章

Activity类方法