摘要: fromHtml还有另一个重构:fromHtml(String source, Html.ImageGetter imageGetter, Html.TagHandler tagHandler)而ImageGetter imgGetter = new Html.ImageGetter() { @Override public Drawable getDrawable(String source) { Drawable drawable = null; drawable = Drawable.createFromPath(source); // Or fetch it from the URL 阅读全文
posted @ 2013-08-16 10:55 一个码农的日常 阅读(962) 评论(0) 推荐(0)
摘要: 文件路径什么都对,可就是提示404错误,最后问题出在了IIS的MIME上,按照下面的办法即可解决。1.在 IIS 管理器中,右键单击要为其添加 MIME 类型的网站或网站目录,单击"属性"。2.单击"HTTP 头"选项卡。3.单击"MIME 类型"。4.单击"新建"。5.在"扩展名"框中,键入文件扩展名:.apk6.在"MIME 类型"框中,键入application/octet-stream7.单击"确定"。 阅读全文
posted @ 2013-08-11 14:35 一个码农的日常 阅读(6209) 评论(0) 推荐(1)
摘要: 要监听android打电话和接电话,只需下面2步骤1.第一步,写一个Receiver继承自BroadcastReceiver 1 import android.app.Service; 2 import android.content.BroadcastReceiver; 3 import android.content.Context; 4 import android.content.Intent; 5 import android.telephony.TelephonyManager; 6 import android.util.Log; 7 8 public class PhoneS. 阅读全文
posted @ 2013-08-07 14:34 一个码农的日常 阅读(646) 评论(0) 推荐(0)
摘要: 在使用ListView时,会遇到当ListView列表滑动到最底端时,添加新的列表项的问题,本文通过代码演示如何动态的添加新的列表项到ListView中。实现步骤:调用ListView的setOnScrollListener()方法设置滑动监听器,实现OnScrollListener接口的方法,判断当列表滑动到最低端时,加载新的列表项。其中OnScrollListener接口需要实现如下两个方法:onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)view 报告滑动状 阅读全文
posted @ 2013-08-04 16:55 一个码农的日常 阅读(2034) 评论(0) 推荐(0)
摘要: 本文给大家演示异步加载图片的分析过程。让大家了解异步加载图片的好处,以及如何更新UI。首先给出main.xml布局文件:简单来说就是 LinearLayout 布局,其下放了2个TextView和5个ImageView。 1 2 7 12 17 22 27 32 37 42 我们将演示的过程是异步从服务器上下载5张不同图片,依次放入这5个ImageView。上下2个TextView 是为了方便我们看是否阻塞了UI的显示。 当然 AndroidManifest.xml 文件中要配置好网络访问权限。1)Handler+Runnable模式... 阅读全文
posted @ 2013-08-04 16:51 一个码农的日常 阅读(471) 评论(0) 推荐(0)
摘要: excel导入时还要保存字体、其背景颜色等信息时读取方法就要改变: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.IO; 6 using System.Data.OleDb; 7 using System.Data; 8 using Microsoft.Office.Interop.Excel; 9 using System.Reflection; 10 using System.Runtime.Inter... 阅读全文
posted @ 2013-05-28 10:09 一个码农的日常 阅读(269) 评论(0) 推荐(0)
摘要: 幻灯片图片浏览器1.布局 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.com/tools" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 android:orientation="vertical" 阅读全文
posted @ 2013-03-02 12:14 一个码农的日常 阅读(1526) 评论(0) 推荐(0)
摘要: 1.布局 1 6 7 13 14 20 21 22 28 29 35 36 37 43 44 50 51 52 2.逻辑控制 1 package com.example.androidtabhost; 2 3 import android.os.Bundle; 4 import android.app.Activity; 5 import android.app.TabActivity; 6 import android.view.LayoutInflater; 7 import androi... 阅读全文
posted @ 2013-02-28 17:13 一个码农的日常 阅读(853) 评论(0) 推荐(0)
摘要: 1.布局 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.com/tools" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 android:orientation="vertical" 6 tools: 阅读全文
posted @ 2013-02-28 16:35 一个码农的日常 阅读(1548) 评论(0) 推荐(0)
摘要: 拖动滑块改变图片透明度1.布局 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.com/tools" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 android:orientation="vertical&quo 阅读全文
posted @ 2013-02-28 16:29 一个码农的日常 阅读(6092) 评论(0) 推荐(0)