- 博客(20)
- 收藏
- 关注
原创 intent方法使用总结
//show webapp:Uri uri = Uri.parse("http://www.google.com");Intent it = new Intent(Intent.ACTION_VIEW,uri);startActivity(it);//show maps:Uri uri = Uri.parse("geo:38.899533,-77.036476");...
2010-11-26 22:13:07 237 1
原创 只接受小数
ditText et = (EditText) findViewById(R.id.text01) ; et.setInputType(0x00002002);或者setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
2010-11-26 22:01:20 79
原创 通过mms传图片
final ConnectivityManager connMgr = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);final int result = connMgr.startUsingNetworkFeature( ConnectivityManager.TYPE_MOBILE...
2010-11-25 19:11:02 156
原创 限制两位小数
EditText txtInput = (EditText) findViewById(R.id.txtInput);txtInput.addTextChangedListener(new TextWatcher() { public void afterTextChanged(Editable edt) { String temp = edt....
2010-11-21 11:00:01 118
原创 经纬度转换
String strLongitude = location.convert(location.getLongitude(), location.FORMAT_SECONDS);String strLatitude = location.convert(location.getLatitude(), location.FORMAT_SECONDS);如37.33168900, -122...
2010-11-20 21:00:14 112
原创 listView 多值显示
<ListView android:id="@+id/SCHEDULE" android:layout_width="wrap_content" android:layout_height="wrap_content"></ListView><?xml version="1.0" encoding="utf-8"?&
2010-11-20 17:06:58 68
原创 两种保存方法
暂时的@Overridepublic void onSaveInstanceState(Bundle savedInstanceState) { // Store UI state to the savedInstanceState. // This bundle will be passed to onCreate on next call. EditText txtName = (E...
2010-11-20 15:53:19 149
原创 记录来电
public class MyCLass extends BroadcastReceiver { // functions here}<receiver android:name="MyClass"> <intent-filter> <action andro...
2010-11-17 16:12:39 63
原创 处理 选择camera gallery 文件夹文件浏览
不同手机拍照之后的保存路径不一样没有找到合适的 目前 我的做法是 文件浏览 然后在找 有更好的解决办法希望跟帖谢谢package com.fileUpload; import java.io.File; import java.util.ArrayList; import java.util.List; import android.app.AlertDia...
2010-11-17 15:46:44 161
原创 ProgressDialog显示问题
@Overridepublic void onCreate(Bundle savedInstanceState) { // do all your other stuff here new Handler().postDelayed(new Runnable() { @Override public void run() { ...
2010-11-14 16:23:27 295
原创 得到内存容量
import android.os.Environment;import android.os.StatFs;public class MemoryStatus { static final int ERROR = -1; static public boolean externalMemoryAvailable() { return android.os...
2010-11-13 19:23:20 75
原创 压缩数据
想压缩一下传递的数据HttpUriRequest request = new HttpGet(url);request.addHeader("Accept-Encoding", "gzip");// ...httpClient.execute(request);InputStream instream = response.getEntity().getConten...
2010-11-12 20:37:41 78
原创 mapView 和textView布局
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_
2010-11-12 19:15:27 120
原创 killBackgroundProcess使用 杀死线程问题
ActivityManager activityManager = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);activityManager.killBackgroundProcess(myProcessId);即使加上权限也没用 后来发现 只有在2.2 上才可以 API level 8...
2010-11-10 17:41:41 246
原创 关于R.styleable的问题
原来想直接想调用程序的东西,但是使用R.styleable的时候 eclipse不能解析了,后来发现原来被删除了此方法public ImageAdapter(Context c) { mContext = c; TypedArray a = obtainStyledAttributes(android.R.styleable.Theme); mGalleryI...
2010-11-09 09:21:21 402
原创 PopupWindow关闭问题
如果我的PopupWindow引入的View通过inflate加入,而且里面有个按钮用来关闭次popupWindow 需要做如下设置public void onClick(View v) { LayoutInflater inflater = (LayoutInflater) roomate.getSystemService(Context.LAYOUT_INFLATE...
2010-11-08 19:35:55 275
原创 通过kml file在mapView上画图
import java.util.ArrayList;import java.util.Iterator;public class NavigationDataSet { private ArrayList<Placemark> placemarks = new ArrayList<Placemark>();private Placemark c...
2010-11-05 11:43:39 156
原创 js检查屏幕是否旋转
// Detect whether device supports orientationchange event, otherwise fall back to// the resize event.var supportsOrientationChange = "onorientationchange" in window, orientationEvent = suppor...
2010-11-05 09:51:02 295
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人