摘要: //获取到LocationManager对象LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); 不用去获取provider对象,直接赋值LocationManager.GPS_PROVIDER实际是就是“gps” 这样或许值有些不准确,但是速度会快很多locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1 * 1000, 1,locationListener); 阅读全文
posted @ 2013-07-26 16:25 halfapple--yao 阅读(204) 评论(0) 推荐(0) 编辑
摘要: locationManager = (LocationManager)LocationActivity.this.getSystemService(Context.LOCATION_SERVICE); locationManager.addGpsStatusListener(statusListener);/** * 卫星状态监听器 */ private List numSatelliteList = new ArrayList(); // 卫星信号 private final GpsStatus.Listener statusListener = new GpsStatus.Lis... 阅读全文
posted @ 2013-06-26 14:45 halfapple--yao 阅读(777) 评论(0) 推荐(0) 编辑
摘要: String path=Environment.getExternalStorageDirectory().getAbsolutePath()+"/图片/1.jpg";Intent intent = new Intent(Intent.ACTION_VIEW);Uri mUri = Uri.parse("file://"+path);intent.setDataAndType(mUri, "image/*");startActivity(intent);这样第一个打开的将是图片文件下的1.jpg文件,其他图片可依此浏览 阅读全文
posted @ 2013-05-21 15:36 halfapple--yao 阅读(93) 评论(0) 推荐(0) 编辑
摘要: android4.0以下 可用privatebooleancatchHomeKey = false; public void onAttachedToWindow() { if (!catchHomeKey) { this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); } super.onAttachedToWindow(); } 然后再在onKeyDown方法中捕获public boolean onKeyDown(int keyCode, KeyEvent event... 阅读全文
posted @ 2013-05-20 14:47 halfapple--yao 阅读(177) 评论(0) 推荐(0) 编辑
摘要: RadioGroup继承与LinearLayout,所以排布方式只能是vertical、horizontal,但是很多时候我们需要多排行显示RadioButton,所以现在可以通过这种方式实现:<RadioGroup android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:id="@+id/group"> <RadioButton a 阅读全文
posted @ 2013-04-26 09:53 halfapple--yao 阅读(257) 评论(0) 推荐(0) 编辑