How:android 1.6版本兼容使用ListFragment思想要点

一、类库支持:

      1.必要文件:android-support-v4.jar

文件介绍:The Support Package includes static "support libraries" that you can add to your Androidapplication in order to use APIs that are either not available for older      platform versions or thatoffer "utility" APIs that aren't a part of the framework APIs. The goal is to simplify yourdevelopment by offering more APIs that you can bundle with your application so you canworry less about platform versions.

      2.如何获取该库:启动SDK Manager->选中Repository->找到并选中Android Compatibility package->点击安装等待完成,截图如下:

     

      完成后可在 <sdk>extras/android/compatibility/v4 目录下找到android-support-v4.jar

    3.如何在自己的android应用开发项目中使用该库:

     

二、代码编写要点:

    1.实现一个fragment的一般组成:

        1.1.res/layout 目录下布局中添加fragment元素,例如:

       

        1.2.fragment对应类实现,例如:

       

        1.3.修改setContentView(),布局实参,例如:

       

        1.4.其余相关模块实现

        1.5.注意事项:含有fragment的Activity要从FragmentActivity继承,该类位置是android.support.v4.app.FragmentActivity

三、该问题相关资源

    1.本文实例源代码

    2.类库解说官方链接

    3.FragMent文档官方链接


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值