如何在android中编写外部库的日志?

时间:2016-01-18 13:07:44

标签: android android-library

我在我的应用程序中使用外部库(ru.truba.touchgallery)。它通过viewpager.Its属性,触摸放大,缩小,滑动图像等显示图像。我的应用程序在使用此库的活动中引发错误。错误输出如下。那么,如何通过Log类将touchgallery库的日志写入android studio的控制台?

E/InputEventReceiver: Exception dispatching input event.
E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
E/MessageQueue-JNI: java.lang.IllegalArgumentException: pointerIndex out of range
                        at android.view.MotionEvent.nativeGetAxisValue(Native Method)
                        at android.view.MotionEvent.getX(MotionEvent.java:2010)
                        at android.support.v4.view.MotionEventCompatEclair.getX(MotionEventCompatEclair.java:32)
                        at android.support.v4.view.MotionEventCompat$EclairMotionEventVersionImpl.getX(MotionEventCompat.java:110)
                        at android.support.v4.view.MotionEventCompat.getX(MotionEventCompat.java:462)
                        at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:1916)
                        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2059)
                        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2436)
                        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2178)
                        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2436)
                        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2178)
                        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2436)
                        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2178)
                        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2436)
                        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2178)
                        at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2383)
                        at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1724)
                        at android.app.Activity.dispatchTouchEvent(Activity.java:2764)
                        at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2332)
                        at android.view.View.dispatchPointerEvent(View.java:8655)
                        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4238)
                        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4094)
                        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3635)
                        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3694)
                        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3660)
                        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3773)
                        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3668)
                        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3830)
                        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3640)
                        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3694)
                        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3660)
                        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3668)
                        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3640)
                        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5940)
                        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5908)
                        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5872)
                        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6030)
                        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:211)
                        at android.os.MessageQueue.nativePollOnce(Native Method)
                        at android.os.MessageQueue.next(MessageQueue.java:153)
                        at android.os.Looper.loop(Looper.java:131)
                        at android.app.ActivityThread.main(ActivityThread.java:5696)
                        at java.lang.reflect.Method.invoke(Native Method)
                        at java.lang.reflect.Method.invoke(Method.java:372)
                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823) 

0 个答案:

没有答案