类型 FragmentTransaction 中的方法 replace(int, Fragment)对于参数(int, Fragment1)不适用
来源:互联网 发布:企业网络监控软件 编辑:程序博客网 时间:2024/04/26 10:54
package com.example.fragment;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.Display;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Display display = getWindowManager().getDefaultDisplay();
if(display.getWidth()>display.getHeight()){
Fragment1 fragment1 = new Fragment1();
//FragmentTransaction
//获取fragment,开启一个事物,加入fragment,提交事物
getFragmentManager().beginTransaction().replace(R.id.main_layout,fragment1).commit();
Log.e("Fragment","fragment1");
}else{
Fragment2 fragment2 = new Fragment2();
getFragmentManager().beginTransaction().replace(R.id.main_layout,fragment2).commit();
Log.e("Fragment","fragment2");
}
}
}
类型 FragmentTransaction 中的方法 replace(int, Fragment)对于参数(int, Fragment1)不适用
0 0
- 类型 FragmentTransaction 中的方法 replace(int, Fragment)对于参数(int, Fragment1)不适用
- FragmentTransaction 中的方法 replace(int, Fragment)对于参数(int, Fragment1)不适用
- 方法 FragmentTransaction.add(Fragment,String)不适用 (参数不匹配; int无法转换)
- The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the
- Android Error - The method replace(int, Fragment) in the type FragmentTransaction is not applicable
- The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the,
- 错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the argum
- The method replace(int, Fragment) in the type FragmentTransaction is not applica
- The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the argument
- The method replace(int, Fragment) in the type FragmentTransaction is not app 解决方法
- The method replace(int, Fragment) in the type FragmentTransaction is not applica
- The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the argument
- The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable...
- FragmentManager#popBackStack()或FragmentTransaction#replace(int, Fragment, String)出现重叠解决方案
- 错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the argum
- .replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is not app
- android学习——The method replace(int, Fragment) in the type FragmentTransaction is not applicable for t
- FragmentTransaction.replace() 你不知道的坑
- Mybatis续、Mapper映射器接口规则
- JavaScript:直接写入 HTML 输出流
- android兼容低版本Fragment
- 【求助】android 用布局界面 button布局 按下响应系统按键事件
- Android Studio的一个问题
- 类型 FragmentTransaction 中的方法 replace(int, Fragment)对于参数(int, Fragment1)不适用
- svn使用
- hdu 3350 #define is unsafe
- 第一篇博客--总结2016--
- (11)图案填充
- Mac OS X 中一些常用的命令行技巧
- Android访问https不成功
- 谁能告诉这个图的 组成方式
- 同时开多个Tomcat方法-不用配置环境变量