- 博客(14)
- 收藏
- 关注
原创 webvIew 添加手势
public class Main extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
2011-05-29 18:35:44 307
原创 右下脚图标
res/drawable/shapecount.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <cor
2011-05-23 09:33:41 98
原创 更新button上的数字
public class CounterButton extends Button{ protected int count=0; protected final Paint myTextPaint = new Paint(); protected final Paint myCirclePaint = new Paint(); ...
2011-05-21 10:36:05 102
原创 沿着路径绘制文字
circle = new Path(); circle.addCircle(150, 150, 100, Direction.CW); private static final String QUOTE = "Now is the time for all " + "good men to come to the aid of their country." ; canvas.dr...
2011-05-15 12:36:55 434
原创 uri转string
public String getRealPathFromURI(Uri contentUri) { String[] proj = { MediaStore.Images.Media.DATA }; Cursor cursor = managedQuery(contentUri, proj, null, null, null); int column_inde...
2011-05-14 10:49:45 71
原创 Bookmark的获得
setContentView(R.layout.main); TextView tv = (TextView) findViewById(R.id.hello); String[] projection = new String[] { Browser.BookmarkColumns.TITLE, Browser.BookmarkColumns.URL }; Cursor mCur ...
2011-05-13 17:42:05 180
原创 操作 Calendar事件
Intent intent = new Intent(Intent.ACTION_VIEW); //Android 2.2+ intent.setData(Uri.parse("content://com.android.calendar/events/" + String.valueOf(calendarEventID))); //Android 2.1 and below. /...
2011-05-13 17:22:25 937
原创 九宫格
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"
2011-05-09 17:35:46 60
原创 统计目录大小和时间删除早期的大文件
为什么要做这些,等你需要的时候你就知道了 private void deleteOldestFile(File directory) { File[] files = directory.listFiles(); Arrays.sort(files, new Comparator<File>() { @Override public int compa...
2011-05-06 18:58:04 99
原创 去掉音乐头部
RandomAccessFile raf = new RandomAccessFile("input.mp3", "rw"); byte[] buf = new byte[65536]; long pos = 0; int len; Random random = new Random(34); while ((len = raf.read(buf)) != -1) { f...
2011-05-05 22:12:54 118
原创 发送地址有空格的处理
try { String urlString = "http://www.hospimedica.com/images/stories/articles/article_images/_CC/20110328 - DJB146.gif"; URL url = new URL(urlString.replaceAll(" ", "%20")); URLConne...
2011-05-04 16:44:18 132
原创 activity 之间共享sharedpreferences
public class AppPreferences { private static final String APP_SHARED_PREFS = "com.aydabtu.BroadcastSMS_preferences"; // Name of the file -.xml private SharedPreferences appSharedPrefs; ...
2011-05-04 15:21:07 248
原创 BitmapFactory.decodeStream使用问题
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); InputStream is = connection.getInputStream();使用HttpURLConnection产生的流只能使用一次 如果你想连续调用这个流 必须重新初始化 例如Options options = n...
2011-05-04 14:35:55 497
原创 eclipse 中没有帮助文档的提示
eclipse没有帮助文档提示,引起这个的原因可能你装了两个sdk,而且路径名不一样,同时你又删除了最早的一个解决办法是: 重新换一下路径了。要出现这个画面 右键任何一个工程 选择属性...
2011-05-03 10:25:41 148
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人