21.得到一个布局的方法
private LayoutInflater inflater;
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
或者:
LayoutInflaer.from(this).inflate(R.layout.xmlName, null);
或者:
getLayoutInflater(this).inflate(R.layout.xmlName, null);
22:通知Notification
defalut 属性: DEFAULT_ALL 使用所有默认值,包括声音,震动,闪光灯
DEFAULT_LIGHT 使用闪光灯
DEFAULT_SOUNDS 使用声音
DEFAULT_VIBRATE 使用振动
(注意在使用ALL 和ViBrate的时候,要给apk加入震动的权限 )
<uses-permission android:name = "android.permission.VIBRATE"/>
23.通过文件名得到对应的ID
getResources().getIdentifier("文件名", "drawable", getActivity().getApplication().getPackageName());
//getActivity()碎片中使用//第一个参数:文件名
//第二个参数:文件类型:drawable,layout
//第三个参数:文件包名
24.得到SDCard的路径
Environment.getExternalStorageDirectory().toString();
25.得到一个目录下的文件列表(带过滤器)
File[] files= new File("文件路径").listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {
// TODO Auto-generated method stub
return false;
}
});
26.把下载下来的模拟器安装到模拟器上
①进入到apk的文件夹
②adb install 名字.apk (可以使用Tab键自动填充名字)
27.自定义SeekBar,PrgoressBar等进度条的背景层等