我在開發者的控制檯中看了一眼,第一次看到了凍結報告而不是崩潰。崩潰很容易從堆棧跟蹤中定義斷點。通常導致一個類/方法被錯誤地定義或實現。崩潰和死機有什麼區別?
但是我從來沒遇到凍結。由於谷歌努力在開發控制檯中做出區分,有什麼區別?
從一般的觀點來看,顯然碰撞是一種力量接近。但是,凍結是否會在沒有力量的情況下減慢用戶體驗?技術上的差異是什麼?與碰撞相比,是否有解決凍結問題的不同方法?
編輯:添加示例堆棧跟蹤。
下面是崩潰的示例堆棧跟蹤非常具體,指向一條故障線。
android.view.InflateException: Binary XML file line #21: Error inflating class android.widget.ZoomControls
at android.view.LayoutInflater.createView(LayoutInflater.java:518)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
at android.view.LayoutInflater.inflate(LayoutInflater.java:383)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at android.widget.ZoomButtonsController.createContainer(ZoomButtonsController.java:262)
at android.widget.ZoomButtonsController.<init>(ZoomButtonsController.java:211)
at android.webkit.WebView.getZoomButtonsController(WebView.java:6313)
at android.webkit.WebView.startDrag(WebView.java:5700)
at android.webkit.WebView.onTouchEvent(WebView.java:5428)
at android.view.View.dispatchTouchEvent(View.java:3885)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
下面是一個例子凍結堆棧跟蹤小於特定沒有指向在故障的直接線或活性。
DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x40027550 self=0xcfc0
| sysTid=2076 nice=0 sched=0/0 cgrp=bg_non_interactive handle=-1345006240
| schedstat=(30958526727 7780212297 24174)
at android.graphics.Bitmap.nativeCreateScaledBitmap(Native Method)
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:556)
at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:722)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:478)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
at android.content.res.Resources.loadDrawable(Resources.java:1727)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:1998)
at android.widget.TextView.<init>(TextView.java:389)
at android.widget.Button.<init>(Button.java:108)
at android.widget.Button.<init>(Button.java:104)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
at android.view.LayoutInflater.createView(LayoutInflater.java:505)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:224)
at android.app.Activity.setContentView(Activity.java:1702)
at com.e3h.usmcknowledge.MainActivity.onCreate(MainActivity.java:37)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1780)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3242)
at android.app.ActivityThread.access$1600(ActivityThread.java:132)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1037)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4196)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
添加堆棧跟蹤可能是明智的,所以我們可以在回答之前確定。 – 2012-03-30 18:08:40