當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。