摘要: package com.example.huadong;import android.app.Activity;import android.app.AlertDialog;import android.app.ProgressDialog;import android.content.DialogInterface;import android.os.Bundle;import android.view.GestureDetector;import android.view.GestureDetector.OnGestureListener;import android.view.KeyEv 阅读全文
posted @ 2013-04-23 20:19 王贺blog 阅读(393) 评论(0) 推荐(0) 编辑
摘要: String urlString = "file:///android_asset/index.html";webview.getSettings().setDefaultTextEncodingName("gbk");view.loadUrl(urlString);让Webview加载的页面居中显示有我知道的俩种方法第一种:WebSettings settings = webView.getSettings();settings.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);LayoutAlgori 阅读全文
posted @ 2013-04-22 21:58 王贺blog 阅读(723) 评论(0) 推荐(0) 编辑
摘要: <LineLayout><ViewFlipper android:id="@+id/ViewFlipper"android:layout_width="fill_parent" android:layout_height="fill_parent"><AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical" andro 阅读全文
posted @ 2013-04-22 21:16 王贺blog 阅读(190) 评论(0) 推荐(0) 编辑
摘要: NotificationManager mNotificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);int icon=android.R.drawable.sym_action_email;long when=System.currentTimeMillis();Notification notification=new Notification(icon,null,when);notification.defaults=Notification.DEFAULT_SOUND;P 阅读全文
posted @ 2013-04-18 20:19 王贺blog 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 一.自定义 dia.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" and 阅读全文
posted @ 2013-04-13 20:16 王贺blog 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 刚从别的博客里看到的 挺好的:中国国家气象局天气预报接口总共提供了三个:http://www.weather.com.cn/data/sk/101010100.htmlhttp://www.weather.com.cn/data/cityinfo/101010100.htmlhttp://m.weather.com.cn/data/101010100.html最详细的信息来自第三个接口。上面url中的101010100是城市代码,这里是北京的城市代码。只需要改变城市代码,就可以得到所在城市的天气信息。笔者在福州,所以选择的城市代码是福州101230101。在浏览器上输入url:http://m 阅读全文
posted @ 2013-03-20 18:19 王贺blog 阅读(1281) 评论(0) 推荐(0) 编辑
摘要: C基础入门第一天(数据类型与运算符): (1)对基本数据类型的了解: 在32 位的系统上short 咔出来的内存大小是2 个byte; int 咔出来的内存大小是4 个byte; long 咔出来的内存大小是4 个byte; float 咔出来的内存大小是4 个byte; double 咔出来的内存大小是8 个byte; char 咔出来的内存大小是1 个byte。 大致知道他们的取值范围,因为在赋值时会出现溢出现象; (2)对操作符的了解(只举经常用到的): +,-,*,/ 不解释; %(重点)用于求余;(给我写一个水仙花数来练练这个求余(搜搜什么是水仙花数)) { int i=15; i. 阅读全文
posted @ 2012-11-11 15:22 王贺blog 阅读(228) 评论(0) 推荐(0) 编辑
摘要: strings.xml<string name="txtMsg">选择你喜欢的壁纸,并长按此图</string> <string name="msg">选择你喜欢的壁纸</string> <string-array name="wallPaperItems"> <item>hello1</item> <item>hello2</item> <item>hello3</item> <item>h 阅读全文
posted @ 2012-11-11 15:16 王贺blog 阅读(412) 评论(0) 推荐(0) 编辑
摘要: 第一种:添加array-string:<string name="selectcity">选择你喜欢的城市</string> <string-array name="city_love"> <item>北京</item> <item>上海</item> <item>南京</item> <item>广州</item> </string-array>直接在activity_main.xml里操作:<Spinne 阅读全文
posted @ 2012-11-10 18:58 王贺blog 阅读(610) 评论(0) 推荐(0) 编辑
摘要: 在res/menu下建立一个menu画布:mune.xml<?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/help" android:title="帮助" /> <item android:id="@+id/our" androi 阅读全文
posted @ 2012-11-06 21:15 王贺blog 阅读(161) 评论(0) 推荐(0) 编辑