多次点击后按钮停止工作

时间:2017-10-13 05:28:33

标签: android button

美好的一天!

我正在努力解决这个应用程序的文字危机。这一个按钮的目的是开始动画。包含在它启动的方法中,禁用按钮直到动画结束。这是按钮调用的方法:

leftTrigger.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            leftTrigger.setEnabled(false);
            if(!computerTurn && !isPlayerLeftAttacking){
                playerLeftHitting();
            }else if(computerTurn && !isPlayerLeftEvading){
                playerLeftEvading();
            }
        }
    });
private void playerLeftEvading(){
    Thread thread = new Thread(new Runnable() {
        @Override
        public void run() {
            isPlayerLeftEvading = true;
            float origin = playerLeft.getX();
            while(playerLeft.getX()>origin-500){
                playerLeft.setX(playerLeft.getX()-15);
                try {
                    Thread.sleep(5);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            playerLeft.setX(origin);
            isPlayerLeftEvading = false;
            Handler handler = getWindow().getDecorView().getHandler();
            handler.post(new Runnable() {
                @Override
                public void run() {
                    leftTrigger.setEnabled(true);
                }
            });
        }
    });
    thread.start();
}

发生的情况是,多次按下按钮后,按钮突然停止工作,颜色变深。 logcat中没有错误日志。那么我做错了什么?导致这类问题的原因以及我们如何解决?

根据请求

编辑,以下是过滤的Logcat日志,仅输出我的项目:

10-13 13:35:34.952 12502-12502/? E/Zygote: v2
10-13 13:35:34.952 12502-12502/? I/libpersona: KNOX_SDCARD checking this for 10161
10-13 13:35:34.952 12502-12502/? I/libpersona: KNOX_SDCARD not a persona
10-13 13:35:34.952 12502-12502/? W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0034
10-13 13:35:34.952 12502-12502/? E/Zygote: accessInfo : 0
10-13 13:35:34.962 12502-12502/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=com.example.dale.projectapp 
10-13 13:35:34.962 12502-12502/? I/art: Late-enabling -Xcheck:jni
10-13 13:35:34.972 12502-12502/? D/TimaKeyStoreProvider: TimaSignature is unavailable
10-13 13:35:34.972 12502-12502/? D/ActivityThread: Added TimaKeyStore provider
10-13 13:35:34.992 12502-12508/? E/art: Failed sending reply to debugger: Broken pipe
10-13 13:35:34.992 12502-12508/? I/art: Debugger is no longer active
10-13 13:35:35.002 12502-12502/? W/ResourcesManager: Resource getTopLevelResources for package com.example.dale.projectappoverlayDirs =Null
10-13 13:35:35.002 12502-12502/? W/ActivityThread: Application com.example.dale.projectapp is waiting for the debugger on port 8100...
10-13 13:35:35.002 12502-12502/? I/System.out: Sending WAIT chunk
10-13 13:35:36.472 12502-12508/com.example.dale.projectapp I/art: Debugger is active
10-13 13:35:36.602 12502-12502/com.example.dale.projectapp I/System.out: Debugger has connected
10-13 13:35:36.602 12502-12502/com.example.dale.projectapp I/System.out: waiting for debugger to settle...
10-13 13:35:36.802 12502-12502/com.example.dale.projectapp I/System.out: waiting for debugger to settle...
10-13 13:35:37.002 12502-12502/com.example.dale.projectapp I/System.out: waiting for debugger to settle...
10-13 13:35:37.202 12502-12502/com.example.dale.projectapp I/System.out: waiting for debugger to settle...
10-13 13:35:37.402 12502-12502/com.example.dale.projectapp I/System.out: waiting for debugger to settle...
10-13 13:35:37.602 12502-12502/com.example.dale.projectapp I/System.out: waiting for debugger to settle...
10-13 13:35:37.802 12502-12502/com.example.dale.projectapp I/System.out: waiting for debugger to settle...
10-13 13:35:38.002 12502-12502/com.example.dale.projectapp I/System.out: debugger has settled (1344)
10-13 13:35:38.072 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.282 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_slice_0_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.342 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_slice_1_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.402 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_slice_2_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.472 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_slice_3_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.542 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_slice_4_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.602 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_slice_5_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.652 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_slice_6_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.712 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_slice_7_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.772 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_slice_8_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.832 12502-12502/com.example.dale.projectapp W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.example.dale.projectapp-1/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.dale.projectapp-1@split_lib_slice_9_apk.apk@classes.dex) because non-0 exit status
10-13 13:35:38.832 12502-12502/com.example.dale.projectapp W/System: ClassLoader referenced unknown path: /data/app/com.example.dale.projectapp-1/lib/arm
10-13 13:35:38.842 12502-12502/com.example.dale.projectapp D/ContextRelationManager: ContextRelationManager() : FEATURE_ENABLED=true
10-13 13:35:38.842 12502-12502/com.example.dale.projectapp I/InstantRun: starting instant run server: is main process
10-13 13:35:38.952 12502-12502/com.example.dale.projectapp W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
10-13 13:35:39.142 12502-12502/com.example.dale.projectapp D/SecWifiDisplayUtil: Metadata value : SecSettings2
10-13 13:35:39.142 12502-12502/com.example.dale.projectapp D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{5733430 I.E...... R.....ID 0,0-0,0}
10-13 13:35:39.142 12502-12598/com.example.dale.projectapp D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
10-13 13:35:39.182 12502-12598/com.example.dale.projectapp D/libEGL: eglInitialize EGLDisplay = 0xdf67f7c4
10-13 13:35:39.182 12502-12598/com.example.dale.projectapp I/OpenGLRenderer: Initialized EGL, version 1.4
10-13 13:35:39.182 12502-12598/com.example.dale.projectapp D/mali_winsys: new_window_surface returns 0x3000,  [1080x1920]-format:1
10-13 13:35:39.192 12502-12502/com.example.dale.projectapp D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
10-13 13:35:39.192 12502-12598/com.example.dale.projectapp D/libGLESv1: STS_GLApi : DTS is not allowed for Package : com.example.dale.projectapp
10-13 13:35:39.232 12502-12502/com.example.dale.projectapp I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@651d72c time:18183958
10-13 13:35:45.852 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:35:45.942 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:35:45.942 12502-12502/com.example.dale.projectapp I/Timeline: Timeline: Activity_launch_request id:com.example.dale.projectapp time:18190662
10-13 13:35:45.992 12502-12502/com.example.dale.projectapp E/Qmage: isQIO : stream is not a QIO file
10-13 13:35:45.992 12502-12502/com.example.dale.projectapp E/Qmage: isQIO : stream is not a QIO file
10-13 13:35:45.992 12502-12502/com.example.dale.projectapp E/Qmage: isQIO : stream is not a QIO file
10-13 13:35:46.002 12502-12502/com.example.dale.projectapp D/SecWifiDisplayUtil: Metadata value : SecSettings2
10-13 13:35:46.002 12502-12502/com.example.dale.projectapp D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{aae07ab I.E...... R.....ID 0,0-0,0}
10-13 13:35:46.032 12502-12598/com.example.dale.projectapp D/mali_winsys: new_window_surface returns 0x3000,  [1080x1920]-format:1

                                                                          [ 10-13 13:35:46.052 12502:12610 W/         ]
                                                                          g2d fimg library does not exist
10-13 13:35:46.062 12502-12502/com.example.dale.projectapp D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
10-13 13:35:46.152 12502-12598/com.example.dale.projectapp D/OpenGLRenderer: endAllActiveAnimators on 0xf34ebb00 (RippleDrawable) with handle 0xf3536970
10-13 13:35:46.152 12502-12502/com.example.dale.projectapp I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@8bda5fa time:18190875
10-13 13:35:46.322 12502-12502/com.example.dale.projectapp V/ActivityThread: updateVisibility : ActivityRecord{57d4c7f token=android.os.BinderProxy@651d72c {com.example.dale.projectapp/com.example.dale.projectapp.Main_Menu}} show : false
10-13 13:35:46.812 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:35:46.882 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:35:46.882 12502-12502/com.example.dale.projectapp I/Timeline: Timeline: Activity_launch_request id:com.example.dale.projectapp time:18191606
10-13 13:35:47.112 12502-12502/com.example.dale.projectapp D/SecWifiDisplayUtil: Metadata value : SecSettings2
10-13 13:35:47.112 12502-12502/com.example.dale.projectapp D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{5f2f4dc I.E...... R.....ID 0,0-0,0}
10-13 13:35:47.132 12502-12598/com.example.dale.projectapp D/mali_winsys: new_window_surface returns 0x3000,  [1080x1920]-format:1
10-13 13:35:47.212 12502-12502/com.example.dale.projectapp D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
10-13 13:35:47.262 12502-12598/com.example.dale.projectapp D/OpenGLRenderer: endAllActiveAnimators on 0xde605800 (RippleDrawable) with handle 0xf3536860
10-13 13:35:47.272 12502-12502/com.example.dale.projectapp I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@714354f time:18191994
10-13 13:35:47.492 12502-12502/com.example.dale.projectapp V/ActivityThread: updateVisibility : ActivityRecord{708d76b token=android.os.BinderProxy@8bda5fa {com.example.dale.projectapp/com.example.dale.projectapp.Registration}} show : false
10-13 13:36:04.792 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:04.882 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:05.862 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:05.952 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:05.992 12502-12502/com.example.dale.projectapp I/Timeline: Timeline: Activity_launch_request id:com.example.dale.projectapp time:18210718
10-13 13:36:06.192 12502-12502/com.example.dale.projectapp D/SecWifiDisplayUtil: Metadata value : SecSettings2
10-13 13:36:06.202 12502-12502/com.example.dale.projectapp D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{1d00858 I.E...... R.....ID 0,0-0,0}
10-13 13:36:06.212 12502-12598/com.example.dale.projectapp D/mali_winsys: new_window_surface returns 0x3000,  [1080x1920]-format:1
10-13 13:36:06.222 12502-12502/com.example.dale.projectapp D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
10-13 13:36:06.312 12502-12502/com.example.dale.projectapp I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@2cbb93b time:18211033
10-13 13:36:06.562 12502-12502/com.example.dale.projectapp D/ViewRootImpl: #3 mView = null
10-13 13:36:07.432 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:07.512 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:07.602 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:07.692 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:07.792 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:07.862 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:07.952 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:08.042 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:08.132 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:08.202 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:08.272 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:08.362 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:08.442 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:08.522 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:08.602 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:08.692 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:08.762 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:08.852 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:09.002 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:09.102 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:09.172 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:09.222 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:09.232 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:09.302 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:09.352 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:09.422 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:09.442 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:09.522 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:09.542 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:09.622 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:09.642 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:09.732 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:09.752 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:09.832 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:09.852 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:09.942 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:09.982 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:10.072 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:10.072 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:10.182 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:10.202 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:10.302 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:10.322 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:10.422 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:10.422 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:10.512 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:10.532 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:10.612 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:10.612 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:10.702 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:10.722 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:10.902 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:10.902 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:11.002 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:11.002 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:11.192 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:11.202 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:11.292 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:11.292 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:11.382 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:11.382 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:11.542 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:11.562 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:11.722 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:11.722 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:11.912 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:11.912 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:12.002 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:12.012 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:12.062 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:12.802 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:12.872 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:12.922 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:12.982 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:13.102 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:13.162 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:13.162 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:13.232 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1
10-13 13:36:13.332 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 0
10-13 13:36:13.362 12502-12502/com.example.dale.projectapp D/ViewRootImpl: ViewPostImeInputStage processPointer 1

1 个答案:

答案 0 :(得分:0)

/Try to use Boolean flag to avoid multiple click until animation stops/

private boolean buttonClicked = false;

leftTrigger.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {

      if(!buttonClicked)
      {
        call animation method
     Note: Once animation done set Boolean flag "True" ie: buttonClicked = true;
      } 
    }
});