`
80245089
  • 浏览: 83904 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论
文章列表

关于ColorStateList

ColorStateList用于加载动态设置背景或者颜色的XML. 1.加载如下的XML <selector xmlns:android="http://schemas.android.com/apk/res/android">     <item android:state_pressed="true" android:color="@color/white" /> <item android:state_pressed="false" android:color="@co ...
1.如果配置文件中设置了data属性.   在启动Activity的时候会调用到getType()方法. 启动Activity类Instrumentation public ActivityResult execStartActivity(         Context who, IBinder contextThread, IBinder token, Activity target,         Intent intent, int requestCode) {         IApplicationThread whoThread = (IApplicationThread) ...
命令sqlite3 1.进入应用的databases目录下.   执行命令sqlite3  db_name.db.进入数据库操作的命令终端.  

android 数据存储

 
android有四种数据存储方式: 1.shared preferences:用来存储键值对格式数据,只可以存储基本数据类型.   ·保存系统配置信息.如个性化设置.   ·一般情况下只能供本应用程序使用.   ·文件(后缀名:xml)保存路径:应用程序包名称/data/data/shared_prefs/***.xml   ·只能保存基本数据类型:putString;putInt;putLong;putFloat;putBoolean;   ·在Activity中可以调用getPreferences保持数据私有(当前Activity名作为文件名称)     也可以调用getSharedPref ...
xfermode影响在Canvas已经有的图像上绘制新的颜色的方式 * 正常的情况下,在图像上绘制新的形状,如果新的Paint不是透明的,那么会遮挡下面的颜色. * 如果新的Paint是透明的,那么会被染成下面的颜色 下面的Xfermode子类可以改变这种行为: AvoidXfermode  指定了一个颜色和容差,强制Paint避免在它上面绘图(或者只在它上面绘图)。 PixelXorXfermode  当覆盖已有的颜色时,应用一个简单的像素XOR操作。 PorterDuffXfermode  这是一个非常强大的转换模式,使用它,可以使用图像合成的16条Porter-Duff规则的任意 ...
1.如果Activity继承ListActivity,不自定义布局文件,直接使用android默认的ListView布局文件.不会出现getView()方法执行多组循环. android默认的ListView布局文件如下: <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list"     android:layout_width="fill_parent"     android:layou ...
有两种方法可以修改安装目录 1.安装到sd卡中,使用如下命令   adb install -s XXX.apk 2.直接更改安装目录的配置文件,如下 adb shell pm setInstallLocation 2 (0:自动;1:手机内存;2:sd卡) reboot
通过命令启动模拟器,如下: emulator -avd 模拟器名称 -noaudio
解决的办法是:将该目录下生成的R.java删除,工程会重新生成一个,就OK了。 有的eclipse的版本里可能需要刷新一下工程,有的不需 要。
1.使用【File】-【Others...】-【Android】-【Android Project】,单击【Next】,选中【Create project from existing sample】单选框,此时Samples复选框可选,选择某个sample,单击【Finish】即可,此后会在eclipse的Package explorer中看到:
android 使用linearlayout,如果组件缺少layout_width和layout_height 会报系统错误,要指定layout_width属性,layout_height属性

Activity window view

一般来讲,Activity就是一个可视的人机交互界面。 每一个Activity都有一个默认的Window,一般来讲,这个Window都是全屏的,当然也有例外,比如Dialog的Window就是非全屏的。Activity也可以利用默认Window以外的其它的Window,比如弹出一个Dialog对话框。 Window里可见的内容,就是一层一层的View。Window里的View是通过setContentView这个接口set进去的,这个ContentView就是Window里处于最根部的View。
下载源代码,将源代码解压到如下的目录(sources文件自己手动创建) android_sdk_installation_folder\platforms\android-8\sources
如下的布局文件,粗体部分省略,会导致显示的界面只有第一个textView组件,之后的都不会显示。 <?xml version="1.0" encoding="utf-8"?> <LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"   android:layout_width="fill_parent"   androi ...
创建新工程的时候,会发生如下错误:   Unable to open class file No such file or directory 解决方法:1.重启eclipse,错误消失 2.网络上普遍的解决方法: Solution:解决方法: The “Build Path” for your Java environment is not setup correctly in Eclipse. To fix this, follow these steps: 1) Open the Preferences Window by clicking “Window -> Prefer ...
Global site tag (gtag.js) - Google Analytics