摘要:
*************用SharedPrefences保存键值对*********************//获得SharedPrefences对象SharedPreferences mySharedPreferences=getSharedPreferences("test",Activity.MODE_PRIVATE);//获得SharedPreferences.Editor对象SharedPreferences.Editor editor=mySharedPreferences.edit();//用putXxx方法保存数据editor.putString(&quo 阅读全文
posted @ 2012-09-24 18:00
言程序
阅读(994)
评论(0)
推荐(0)
摘要:
一:java代码实现动画1:旋转(Rotation)***************AnimationSet主要用来多个动画同时进行的时候用的*******************************************************AnimationSet animationSet=new AnimationSet(true);**********Animation.RELATIVE_TO_SELF,0.5f这两个参数是相对控件自己宽度一半的作为旋转中心的横坐标*************************************除了Animation.RELATIVE_ 阅读全文
posted @ 2012-09-24 15:24
言程序
阅读(286)
评论(0)
推荐(0)
摘要:
<?xml version="1.0" encoding="UTF-8"?>-<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> <!-- android:shape="" 表示是圆角矩形还是椭圆等等 --> <solid android:color="@color/green"/> <!- 阅读全文
posted @ 2012-09-24 14:27
言程序
阅读(150)
评论(0)
推荐(0)
摘要:
方法 inflate(int resource, ViewGroup root, boolean attachToRoot) 中,前连个参数都好理解,我比较费解的是第3个参数。1: 第一种情况显示checkBox: setContentView(R.layout.main);ViewGroupv= (ViewGroup)findViewById(R.id.ffff);Viewvv=LayoutInflater.from(this).inflate(R.layout.ffff,v);2:如果把代码改成这样 View vv = LayoutInflater.from(this).inflat... 阅读全文
posted @ 2012-09-24 14:08
言程序
阅读(1074)
评论(0)
推荐(0)
摘要:
子界面经常要传命令给主Activity,让主Activity来实行调用其他界面的功能,怎么完成,就看接口的使用:(1)首先在子界面定义接口,这里子界面是一个Fragment:public interface MeClickInterface { void meClick(); }(2)然后再Fragment实现接口的引用:private MeClickInterface mci;(3)定义方法,将导入的引用全局化(这一步很重要,如果没有这一步,实现接口的类和定义接口的类将不会相关联):public void setMeclick(final MeClickInterface mci){t... 阅读全文
posted @ 2012-09-24 12:10
言程序
阅读(187)
评论(0)
推荐(0)