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

public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { View parentView = inflater.inflate(R.layout.fragment1, container, false); SharedPreferences pre = getActivity().getSharedPeferences(CFG,);
//getSharedPeferences("myinfo",Context.MODE_PRIVATE); return parentView; }

使用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. Linux的bg和fg命令简单介绍

    我们都知道,在 Windows 上面,我们要么让一个程序作为服务在后台一直运行,要么停止这个服务.而不能让程序在前台后台之间切换.而 Linux 提供了 fg 和 bg 命令,让我们轻松调度正在运行的 ...

  2. spoj 3871. GCD Extreme 欧拉+积性函数

    3871. GCD Extreme Problem code: GCDEX Given the value of N, you will have to find the value of G. Th ...

  3. VC++检测当前网络状态

    VC获得本机网络连接状态 转载:http://www.cppblog.com/wrhwww/archive/2010/12/02/135230.html //本机网络连接类型(成功) #define ...

  4. XMPP Server

    XMPPFramework,编译失败,@import libxmlSimu后提示:Module 'libxmlSimu' not found XMPP协议实现原理介绍 XMPP协议学习笔记 四.地址格 ...

  5. Python3基础 print 自带换行功能

    镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ ...

  6. 【leetcode❤python】107. Binary Tree Level Order Traversal II

    #-*- coding: UTF-8 -*- # Definition for a binary tree node.# class TreeNode(object):#     def __init ...

  7. FZU 2147 A-B Game

    A-B Game Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Sta ...

  8. The Pilots Brothers' refrigerator

    2965 he Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1 ...

  9. Know How And When To Use System.Message_Level To Control Messages In Oracle Forms

    SYSTEM.MESSAGE_LEVEL is used to control the messages that end users see when they use the Oracle For ...

  10. FJNU 1155 Fat Brother’s prediction(胖哥的预言)

    FJNU 1155 Fat Brother’s prediction(胖哥的预言) Time Limit: 1000MS   Memory Limit: 257792K [Description] [ ...