01-03 13:20:36.687: E/AndroidRuntime(8513): FATAL EXCEPTION: main
01-03 13:20:36.687: E/AndroidRuntime(8513): android.app.RemoteServiceException: Bad notification posted from package com.zl: Couldn't expand RemoteViews for: StatusBarNotification(package=com.zl id=224968 tag=null notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x2))
01-03 13:20:36.687: E/AndroidRuntime(8513): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1048)
01-03 13:20:36.687: E/AndroidRuntime(8513): at android.os.Handler.dispatchMessage(Handler.java:99)
01-03 13:20:36.687: E/AndroidRuntime(8513): at android.os.Looper.loop(Looper.java:130)
01-03 13:20:36.687: E/AndroidRuntime(8513): at android.app.ActivityThread.main(ActivityThread.java:3687)
01-03 13:20:36.687: E/AndroidRuntime(8513): at java.lang.reflect.Method.invokeNative(Native Method)
01-03 13:20:36.687: E/AndroidRuntime(8513): at java.lang.reflect.Method.invoke(Method.java:507)
01-03 13:20:36.687: E/AndroidRuntime(8513): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
01-03 13:20:36.687: E/AndroidRuntime(8513): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
01-03 13:20:36.687: E/AndroidRuntime(8513): at dalvik.system.NativeStart.main(Native Method)
该bug目前只发现会在 Samsung S5830i(系统版本:android 2.3.6) 上出现
bug产生原因:
Notification n = new Notification(); RemoteViews expandedView = new RemoteViews("com.zl.MainActivity", R.layout.status_progress_bar); n.contentView = expandedView;
R.layout.status_progress_bar 使用了自定义的 ProgressBar的子类,导致报找不到该类的错误
RemoteViews
不过这个bug在其他机器上没有出现过
2013.11.14 ——— git学习之分支操作
git branch //显示当前分支 git branch test //新建一个test的本地分支 git branch -d test //删除test分支 git checkout -b dev origin/dev //检出一个远程分支的本地分支 或者 git checkout --track origin/dev //这个默认本地分支名字为dev 上面的可以改变名字 git checkout XXX //切换分支 git checkout -b test //新建并切换的test本地分支
问题1、在master上面的一个commit,但是应该是在dev上修改的,修改错了,这个时候 需要把master的commit移到dev上来,总不能重新修改吧
git checkout master git log $ git log commit ec8c07e36327c2418b7774cfbcd997d9fb178c95 Author: lipeng <lipeng@xunlei.com> Date: Thu Nov 14 10:53:49 2013 +0800 lipeng update 'recommend' expandableListView commit e7d10875796d32b34b60efe3bfd4178b5f102c2f Author: xuyong <suyong@xunlei.com> Date: Wed Nov 13 16:42:23 2013 +0800 恢复到merge dev分支新搜索界面时落了些东西 commit 13c4fda4305e658865a99ca3d4988e3409ecf589 Author: xuyong <suyong@xunlei.com> Date: Wed Nov 13 16:19:04 2013 +0800 恢复到merge dev分支新搜索界面之前 然后 复制下你要移动的那个commit ec8c07e36327c2418b7774cfbcd997d9fb178c95 git checkout dev git cherry-pick ec8c07e36327c2418b7774cfbcd997d9fb178c9
这样就ok了
问题二:master已经的那个commit已经复制过去了 但是master上面依然还有那个commit,我们需要删除这个commit
git checkout master git reset HEAD~ //删除第一个commit ~后面可以跟数字 表示最近的几次提交 git log //发现最近的一次提交没有了 git status //如下 发现暂存区里面还有很多东西 # On branch master # Changes not staged for commit: # (use "git add/rm <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: PhoneKankan/res/layout/fragment_recommend.xml # modified: PhoneKankan/res/layout/home_video_gridview.xml # modified: PhoneKankan/res/layout/video_image_item.xml # modified: PhoneKankan/src/com/kankan/phone/recommend/RecommendFragmen .java # deleted: PhoneKankan/src/com/kankan/phone/recommend/VideoGridView.ja a # modified: PhoneKankan/src/com/kankan/phone/recommend/VideoGroupListVi wAdapter.java # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # PhoneKankan/res/layout/home_video_gridview_title.xml # PhoneKankan/src/com/kankan/phone/recommend/MyGridView.java no changes added to commit (use "git add" and/or "git commit -a") git checkout -f //取消所有暂存区修改 git status //新加的没有跟踪的文件 还是存在的 需要手动删除下 # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # PhoneKankan/res/layout/home_video_gridview_title.xml # PhoneKankan/src/com/kankan/phone/recommend/MyGridView.java nothing added to commit but untracked files present (use "git add" to track) $ rm PhoneKankan/res/layout/home_video_gridview_title.xml Sun@COSTARTER /e/Project/kankan (master) $ rm PhoneKankan/src/com/kankan/phone/recommend/MyGridView.java Sun@COSTARTER /e/Project/kankan (master) $ git status # On branch master nothing to commit, working directory clean
另外 简单起见 也可以使用
git reset --hard HEAD~
会将最新的1次提交全部重置,就像没有提交过一样。
JAVA实例100部