WindowManager wm = ((WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE));


Cursor cursor = getContentResolver().query(People.CONTENT_URI, null, null, null, null); 

解释:Cursor cursor = getContentResolver().query(People.CONTENT_URI, null, null, null, null);先获得一个指向系统通讯录数据库的Cursor对象获得数据来源。



startManagingCursor(cursor); 

解释:This method allows the activity to take care of managing the given Cursor's lifecycle for you based on the activity's lifecycle. That is, when the activity is stopped it will automatically call deactivate() on the given Cursor, and when it is later restarted it will call requery() for you. When the activity is destroyed, all managed Cursors will be closed automatically.
startManagingCursor(cursor);我们将获得的Cursor对象交由Activity管理,这样Cursor的生命周期和Activity便能够自动同步,省去自己手动管理Cursor。



newfs_msdos /dev/block/mmcblk3p2
清数据


ListAdapter listAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_expandable_list_item_1,                 cursor,                new String[]{People.NAME},                 new int[]{android.R.id.text1});  

解释:SimpleCursorAdapter 构造函数前面3个参数和ArrayAdapter是一样的,最后两个参数:一个包含数据库的列的String型数组,一个包含布局文件中对应组件id的int型数组。其作用是自动的将String型数组所表示的每一列数据映射到布局文件对应id的组件上。上面的代码,将NAME列的数据一次映射到布局文件的id为text1的组件上。


mTextViews[1].setTextAppearance(mContext,android.R.attr.textAppearanceSmall)

解释: 引用 Text color, typeface, size, and style for "small" text.

public static final int textAppearanceSmall
Since: API Level 1

Text color, typeface, size, and style for "small" text. Defaults to secondary text color.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".
Constant Value: 16842818 (0x01010042)

详见:
http://androidappdocs.appspot.com/reference/android/R.attr.html


动态添加perssion:
引用 权限树(permission-tree)
权限树的设置是为了统一管理一组权限,声明于该树下的权限所有者归属该应用。系统提供了API,应用可以在运行时动态添加。
 PackageManager.addPermission()

得到PackageName的方式:
1
ActivityManager mActivityManager;List<ActivityManager.RunningServiceInfo> mList;mActivityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);mList = mActivityManager.getRunningServices(20);for(ActivityManager.RunningServiceInfo am : mList) {    datas.add(am.service.getPackageName());    }

2
intent.getComponent().getPackageName()


3
am.baseActivity.getPackageName()



killBackgroundProcesses
ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);   am.killBackgroundProcesses("cn.com.android123.cwj"); 



 ActivityManager.RunningAppProcessInfo runinfo

pm = ctx.getApplicationContext().getPackageManager()


http://t.baidu.com/guide/avatar


清数据
newfs_msdos /dev/block/mmcblk3p2


【让本view位于父view的横向中间】
android:layout_gravity="center_horizontal"

更多相关文章

  1. 《android关于WIFI的操作》
  2. 模仿Android(安卓)location provider
  3. Android(安卓)定时到服务器取数据并刷新
  4. Android使用SAX解析XML(3)
  5. android 语音识别
  6. Android(安卓)数据库SQLite的操作总结
  7. android 滑动加载数据
  8. mybatisplus的坑 insert标签insert into select无参数问题的解决
  9. 箭头函数的基础使用

随机推荐

  1. 设置mysql5.7远程连接
  2. Linux服务器安装php之后连接MySQL数据失
  3. 如何限制SQL Server中的用户登录尝试
  4. 各位大虾,快救救我,我的sql server7为什么
  5. Mysql的一些纪要
  6. oracle ebs r12报告的Oracle flex值层次
  7. Sql server创建存储过程
  8. 利用纯真IP库建立mysql ip数据库
  9. SQL根据某个字段分组查询:
  10. 特殊符号对应的ASCII码