当前位置: 首页>>代码示例>>Java>>正文


Java OFragmentUtils类代码示例

本文整理汇总了Java中com.odoo.core.utils.OFragmentUtils的典型用法代码示例。如果您正苦于以下问题:Java OFragmentUtils类的具体用法?Java OFragmentUtils怎么用?Java OFragmentUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OFragmentUtils类属于com.odoo.core.utils包,在下文中一共展示了OFragmentUtils类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadDrawerItemInstance

import com.odoo.core.utils.OFragmentUtils; //导入依赖的package包/类
/**
 * Loads fragment or start intent
 *
 * @param instance, instance of fragment or intent
 */
private void loadDrawerItemInstance(Object instance, Bundle extra, boolean addToBackstate) {
    if (instance != null) {
        if (instance instanceof Intent) {
            Log.i(TAG, "Loading intent: " + instance.getClass().getCanonicalName());
            startActivity((Intent) instance);
        }
        if (instance instanceof Class<?>) {
            Class<?> cls = (Class<?>) instance;
            Intent intent = null;
            if (cls.getSuperclass().isAssignableFrom(Activity.class)) {
                intent = new Intent(this, cls);
            }
            if (cls.getSuperclass().isAssignableFrom(ActionBarActivity.class)) {
                intent = new Intent(this, cls);
            }
            if (intent != null) {
                if (extra != null)
                    intent.putExtras(extra);
                loadDrawerItemInstance(intent, null, addToBackstate);
                return;
            }
        }
        if (instance instanceof Fragment) {
            Log.i(TAG, "Loading fragment: " + instance.getClass().getCanonicalName());
            OFragmentUtils.get(this, mSavedInstanceState).startFragment((Fragment) instance, addToBackstate, extra);
        }
    }
    closeDrawer();
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:35,代码来源:OdooActivity.java

示例2: loadDrawerItemInstance

import com.odoo.core.utils.OFragmentUtils; //导入依赖的package包/类
/**
 * Loads fragment or start intent
 *
 * @param instance, instance of fragment or intent
 */
private void loadDrawerItemInstance(Object instance, Bundle extra) {
    if (instance != null) {
        if (instance instanceof Intent) {
            Log.i(TAG, "Loading intent: " + instance.getClass().getCanonicalName());
            startActivity((Intent) instance);
        }
        if (instance instanceof Class<?>) {
            Class<?> cls = (Class<?>) instance;
            Intent intent = null;
            if (cls.getSuperclass().isAssignableFrom(Activity.class)) {
                intent = new Intent(this, cls);
            }
            if (cls.getSuperclass().isAssignableFrom(ActionBarActivity.class)) {
                intent = new Intent(this, cls);
            }
            if (intent != null) {
                if (extra != null)
                    intent.putExtras(extra);
                loadDrawerItemInstance(intent, null);
                return;
            }
        }
        if (instance instanceof Fragment) {
            Log.i(TAG, "Loading fragment: " + instance.getClass().getCanonicalName());
            OFragmentUtils.get(this, mSavedInstanceState).startFragment((Fragment) instance, false, extra);
        }
    }
    closeDrawer();
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:35,代码来源:OdooActivity.java

示例3: loadFragment

import com.odoo.core.utils.OFragmentUtils; //导入依赖的package包/类
public void loadFragment(Fragment fragment, Boolean addToBackState, Bundle extra) {
    OFragmentUtils.get(this, null).startFragment(fragment, addToBackState, extra);
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:4,代码来源:OdooActivity.java


注:本文中的com.odoo.core.utils.OFragmentUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。