摘要: 1.回退上一级地址String savepath= "http://zhidao.baidu.com/question/147458024.html";savepath.substring(0, savepath.lastIndexOf("/"))结果:http://zhidao.baidu.com/question 阅读全文
posted @ 2013-07-12 09:11 马骝 阅读(116) 评论(0) 推荐(0)
摘要: 同时finish两个Activityclass A{onCreate{Intent i=new Intent();i.setClass(this,B.class);startActivityForResult(i, 0);} @Override//当调用setResult(RESULT_CODE_BACK)才执行 protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub super.onAc... 阅读全文
posted @ 2013-07-01 15:05 马骝 阅读(203) 评论(0) 推荐(0)
摘要: 实现了点击home键后启动通知,退出时销毁通知NotificationManager notiManager;@Override protected void onStop() { addNotification();//启动通知 super.onStop(); }@Override protected void onDestroy() {cancelNotification(notiManager);} public void cancelNotification(NotificationManager notiManager){ if(null!=notiManager){ ... 阅读全文
posted @ 2013-06-06 22:27 马骝 阅读(384) 评论(0) 推荐(0)
摘要: final static int LOGIC_SERVICE_TIMEOUT = 2;Handler handler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case LOGIC_SERVICE_TIMEOUT: Toast.makeText(MainActivity.this, "请求超时", 1).show(); break; ... 阅读全文
posted @ 2013-05-20 17:54 马骝 阅读(292) 评论(0) 推荐(0)
摘要: 删除时长按异常 if (LocalPhoneInfo.IS_I_VERSION && !managerEnabled) {1.TabPage :每个页面的所有按键。 tab 和两个按钮2.主页面所有点击事件都在此:@Override public void onClick(View v) { switch (v.getId()) { case R.id.local_tab: setCurrentTab(LOCAL_TAB); break; case R.id.online_tab: ... 阅读全文
posted @ 2013-05-07 01:01 马骝 阅读(169) 评论(0) 推荐(0)
摘要: 第一种//获取设置的配置信息int ori = this.getResources().getConfiguration().orientation; //获取屏幕方向 if(ori == Configuration.ORIENTATION_LANDSCAPE){ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); Toast.makeText(this, 11+ "横屏", 0).show(); }else if(ori == Configuration.OR... 阅读全文
posted @ 2013-05-02 00:51 马骝 阅读(957) 评论(0) 推荐(0)
摘要: #6b6b6b如改为80%透明256*0.8 再转换成16进制 cc#cc6b6b6b颜色渐显Specifies a gradient color for the shape.attributes:android:angleInteger. The angle for the gradient, in degrees. 0 is left to right, 90 is bottom to top. It must be a multiple of 45. Default is 0.android:centerXFloat. The relative X-position for the ce 阅读全文
posted @ 2013-04-27 16:57 马骝 阅读(517) 评论(0) 推荐(0)
摘要: http://blog.csdn.net/wangjinyu501/article/details/8169924 阅读全文
posted @ 2013-04-27 11:24 马骝 阅读(116) 评论(0) 推荐(0)
摘要: 之前我写了一个相关的帖子,但是今天看了一个还是写的比我详细,于是我拿过来和大家分享。1.在程序中添加一个断点如果所示:在Eclipse中添加了一个程序断点在Eclipse中一共有三种添加断点的方法第一种: 在红框区域右键出现菜单后点击第一项 Toggle Breakpoint 将会在你右键代码的哪一行添加一个程序断点 (同样的操作方可取消程序断点)第二种: 在红框区域双击鼠标左键将会在你双击代码的哪一行添加一个程序断点 (同样的操作方可取消程序断点)第三种 :在光标停留的地方使用快捷键 Ctrl + Shift +B 将会在光标停留的这一行添加一个程序断点 (同样的操作方可取消程序断点)2.运 阅读全文
posted @ 2013-04-26 22:39 马骝 阅读(238) 评论(0) 推荐(0)
摘要: <?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:color="#000000"/> 黑色 <item android:state_focused="true" android:colo 阅读全文
posted @ 2013-04-25 23:48 马骝 阅读(394) 评论(0) 推荐(0)