转:Android学习5 ....................
1 将SDk的源代码添加到您的工程中
http://android.opensourceror.org/2010/01/18/android-source/
http://stuffthathappens.com/blog ... -source-in-eclipse/
2 在资源文件中,添加引号,即要在文本中显示引号,如果直接在XML上添加引号的话,会被直接过滤掉:
1 <string name="hello">您好, 我是"梦书"</string><br>
以上的代码显示出来是: 您好,我是梦书 而不是 您好,我是"梦书"
应该用转移符号"/"
1 <string name="hello">您好, 我是/"梦书/"string><br>
3 Android在接收到一个广播intent之后,在找到了处理该intent的broadcast receiver后,就创建一个对象来处理intent。
然后,调用被创建的broadcast receiver对象的onReceive方法进行处理,接着就撤销这个对象。需要注意的是,对象在onReceive方法返回之后就被撤销,所以在onReceive方法中不宜处理异步的过程,如弹出对话框与用户交互,可使用消息栏替代。
4 通知服务- ((NotificationManager)paramContext.getSystemService("notification")).cancel(paramInt);
复制代码 5 查看某个联系人的详细信息- Intent intent = new Intent(Intent.ACTION_VIEW, //查看联系信息
- ContentUris.withAppendedId(People.CONTENT_URI, id));
- startActivity(intent);
复制代码 |