本文整理匯總了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();
}
示例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();
}
示例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);
}