使用fragmenttabhost后,子fragment怎么获取ID?怎么用getSharedPreferences

  1. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  2. Bundle savedInstanceState) {
  3.  
  4. View parentView = inflater.inflate(R.layout.fragment1, container, false);
  5.  
  6. SharedPreferences pre = getActivity().getSharedPeferences(CFG,);
  7. //getSharedPeferences("myinfo",Context.MODE_PRIVATE);
  8.  
  9. return parentView;
  10.  
  11. }

使用fragmenttabhost后,子fragment怎么获取ID?怎么用getSharedPreferences的更多相关文章

  1. Android Studio Fragment 无法获取 id的方法

    在Fragment中,因为继承的父类的不同,导致在Fragment中无法获取到控件的id,此时,只要在获取findviewbyid前加上  getView()就可以了.

  2. 【Android】Fragment如何获取子Fragment

    今天搞了个嵌套的Fragment,通过外部的Fragment获取的子Fragment代码: this.navigationBar = (HXKJCargoNavigationView) getFrag ...

  3. 页面中php传值后循环列表js获取点击的id

    页面中php传值后循环列表js获取点击的id值进行js操作 <script type="text/javascript" src="__PUBLIC__/js/jq ...

  4. 【MyBtis】获取数据插入postgresql后返回的自增id

    问题描述 数据库采用的是postgresql,以下面的rule表为例,该表的id设置为自增,那么经常有这样的需求,在执行insert操作后,紧接着需要获取该记录的自增id往中间表中插入数据,或者是再根 ...

  5. 子Fragment获取父Fragment

    在子Fragment操作父Fragment的思路 ((FragmentRecyclerBD)FragmentAppointmentBD.this.getParentFragment()).change ...

  6. mybatis+mysql insert添加数据后返回数据主键id

    1.根据useGeneratedKeys获取返回值,部分数据库不支持 修改mybatis xml <insert id="insertUser" useGeneratedKe ...

  7. 弹框modal, 获取id与绑定id

    var span2 = '<span class="replaceBlue cursor" data-target="#myModalMember" da ...

  8. vue 父组件主动获取子组件的数据和方法 子组件主动获取父组件的数据和方法

    Header.vue <template> <div> <h2>我是头部组件</h2> <button @click="getParen ...

  9. vue 的父组件和子组件互相获取数据和方法

    父组件主动获取子组件的数据和方法 一.ref(但不能实时更新获取) 1.调用子组件的时候 定义一个ref <child ref="headerChild"></c ...

随机推荐

  1. html的<marquee></marquee>标签实现滚动效果

    页面的自动滚动效果,可由javascript来实现,但是今天无意中发现了一个html标签 - <marquee></marquee>可以实现多种滚动效果,无需js控制. 使用m ...

  2. python学习笔记三 函数(基础篇)

    函数 内置函数 常用的内建函数: type()  列出指定对象的类型 help()  能够提供详细的帮助信息 dir()    将对象的所有特性列出 vars()  列出当前模块的所有变量 file, ...

  3. Struts2的类型转换

    Struts2的类型转换 类型转换的作用: HTTP请求都是字符串类型,需要把这些字符串类型转化成相应的数据类型,使得Web应用的控制组件可以使用. 1.內建的类型转换器 Struts2可以完成大多数 ...

  4. Mac 下Cordova开发

    一 Cordova开发环境搭建 1,安装node.js环境 官网: http://nodejs.org/  下载包安装 2,使用命令行安装 cordova 主要命令: 安装Cordova: sudo ...

  5. 编写2个接口:InterfaceA和InterfaceB;在接口InterfaceA中有个方法void printCapitalLetter();在接口InterfaceB中有个方法void printLowercaseLetter();然 后写一个类Print实现接口InterfaceA和InterfaceB,最后再在主类E 的main方法中创建Print的对象并赋值,运行方法

    package lianxi; public interface InterfaceA { void printCapitalLetter(); } package lianxi; public in ...

  6. mimikatz2.0抓取WINDOWS密码

    看吾爱的,刚好问同事说这个也用过,以后内网渗透的话比较方便 http://www.52pojie.cn/thread-264895-1-1.html ========================= ...

  7. 03_Spring工厂接口

    Spring工厂接口 1.BeanFactory 接口 和 ApplicationContext 接口区别 ?      * ApplicationContext 接口继承BeanFactory接口, ...

  8. python_way day14 CSS

    python_way day14 CSS 层叠样式表 一.CSS作用域: 二.css标签选择器 三.css样式 一.css作用域: 基本用法:style="样式" <body ...

  9. Codeforces Round #377 (Div. 2) C. Sanatorium 水题

    C. Sanatorium time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  10. 常见Android测试工具简介

    在进行android设备测试过程中,在进行系统测试时候,往往需要关注到很多方面,导致一个崩溃或者运行一段时间自动重启或者停止的问题很多.最简单来看,影响因素就有:底层硬件设备.OS层.上层app层.另 ...