上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页
摘要: public class ShareUtils { /** * 分享功能 * @param context 上下文 * @param activityTitle Activity的名字 * @param msgTitle 消息标题 * @param msgText 消息内容 * @param imgPath... 阅读全文
posted @ 2016-10-01 16:30 杨伟乔 阅读(536) 评论(0) 推荐(0) 编辑
摘要: = 电话拨号器/点击事件写法 =开发安卓应用步骤: - 1. 写UI, 即布局文件. - 2. 写代码, Activity, ContentProvider, Service, 等等. - 3. 在清单文件中配置 Activity 等四大组件. - 4. 在清单文件中添加权限. 下面开发一个电话拨号器应用. 首先是写布局文件:{{{class="brush:xml" ... 阅读全文
posted @ 2016-10-01 16:29 杨伟乔 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 对于低密度屏幕的手机, 使用一般的方法是无法的到准确密度的. 需要在清单文件里做如下配置: 来自为知笔记(Wiz) 阅读全文
posted @ 2016-10-01 16:29 杨伟乔 阅读(204) 评论(0) 推荐(0) 编辑
摘要: TextView通常用来显示普通文本,但是有时候需要对其中某些文本进行样式、事件方面的设置。Android系统通过SpannableString类来对指定文本进行相关处理,具体有以下功能:1、BackgroundColorSpan 背景色 2、ClickableSpan 文本可点击,有点击事件3、ForegroundColorSpan 文本颜色(前景色)4、MaskFilterSpan 修饰效果,... 阅读全文
posted @ 2016-10-01 16:28 杨伟乔 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1. 开机 如果想在receiver中启动一个activity, 要给intent加一个flagpublic class StartupReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { In... 阅读全文
posted @ 2016-10-01 16:28 杨伟乔 阅读(255) 评论(0) 推荐(0) 编辑
摘要: Android 3.0 sdk,引入了很多新api,比如Loader。和Fragment类似(编写兼容android1.6的fragment),该api也可在Android 1.6以上版本执行。以下介绍如何编写Loader,实现对ListView的异步加载。效果如图:示例中有一个后台线程每隔3秒更新数据库的长江记录,将记录改为“长江”或“Long River”。ListView无需监控数据库... 阅读全文
posted @ 2016-10-01 16:27 杨伟乔 阅读(446) 评论(0) 推荐(0) 编辑
摘要: public static String saveView2Bitmap(Context context,View view,String fileName) { Bitmap bitmap = null; if(context == null || view == null || TextUtils.isEmpty(fileName)){ ... 阅读全文
posted @ 2016-10-01 16:26 杨伟乔 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 使用这个类可以改变textview中的文字的样式, 比如颜色, 大小, 下划线等等.一:TextView组件改变部分文字的颜色: Java代码 TextView textView = (TextView)findViewById(R.id.textview); //方法一: textView.setText(Html.fromHtml("红色其它颜色")); //方法二: St... 阅读全文
posted @ 2016-10-01 16:25 杨伟乔 阅读(520) 评论(0) 推荐(0) 编辑
摘要: Integer[] mButtonState = { R.drawable.defaultbutton, R.drawable.focusedpressed, R.drawable.pressed };Button mButton = (Button) findViewById(R.id.button);mButton.setBackgroundDrawable(my... 阅读全文
posted @ 2016-10-01 16:25 杨伟乔 阅读(424) 评论(0) 推荐(0) 编辑
摘要: 在android中使用shape资源来定义一个形状. 可以减小安装包大小, 在 Eclipse 中创建 xml 的时候, 选 drawable, 放在 drawable 目录中. 如下图所示 下面有一个矩形的例子 --> -->注意: 1. shape 元素的 android:shape 只有四个值:... 阅读全文
posted @ 2016-10-01 16:23 杨伟乔 阅读(342) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页