本文整理汇总了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);
}