마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

이벤트가 발생할때 한번 두번은 터치해야 되네요..

0 추천
현재 프로젝트에 엑티비티의 구조가

'A->B->C->D'  이렇습니다.

넘어가는 방식은 TextView나 Button에 이벤트 또는 onClick을 이용하는데,

원 터치만으로 넘어가지지가 않습니다.

현재 상황) 'A->B'와 'B->C' 는 터치 한번에 빠르게 넘어감.

'C->D'와 'D->C' 는 절대 터치 한번에 액티비티가 넘어가지 않습니다.

정확히 터치다운,업 사이클이 최소 2번은 일어나야 넘어가집니다. 왜그럴까요?..처음에는 실험용 폰이

많이 느리구나 했는데 정확히 테스트를 해보니 그렇더군요..흠.. 혹시 문제의 원인이 있는건가요?

 

그리고 추가로 질문이 또 있습니다..ㅠ 이번에도 'C->D'와 'D->C'에서의 문제인데

TextView로는 이벤트가 발생하지 않아요. 터치다운, 업이 일어나는데 그에 맞게 이벤트처리가 안된다고 할까요?... 테스트를 해보려고 Toast를 이용해 소스를 넣어봤지만 역시나 이벤트 자체가 실행이 안되요. 그런데 Button으로는 정상적으로 작동을하는데 왜그런걸까요?..

혹시 이것도 연관해서 문제가 있는걸까요?
맹꾸 (500 포인트) 님이 2016년 1월 5일 질문

1개의 답변

0 추천
xml과 코드를 봐야 짐작이 가능할것 같습니다..
캬옹이 (37,920 포인트) 님이 2016년 1월 5일 답변
D 코드입니다 C코드는 너무길어서 D보여드립니당!

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="stone.white.smft10.TimeAdd2"
    android:orientation="vertical"
    android:gravity="center"
    android:background="#ffffff">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <Button
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#FF0099"
            android:layout_weight="1"
            android:gravity="center"
            android:textSize="40dp"
            android:id="@+id/hotPink"
            android:onClick="onColorCho" />
        <Button
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#FFCCCC"
            android:layout_weight="1"
            android:gravity="center"
            android:textSize="40dp"
            android:id="@+id/pink"
            android:onClick="onColorCho"/>
        <Button
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#CCFF33"
            android:layout_weight="1"
            android:gravity="center"
            android:textSize="40dp"
            android:id="@+id/yellow"
            android:onClick="onColorCho"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ffffff"
            android:layout_weight="1"
            android:text="완료"
            android:id="@+id/bt_ok"/>
        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ffffff"
            android:layout_weight="1"
            android:text="취소"
            android:id="@+id/bt_cancel"/>
    </LinearLayout>

</LinearLayout>
...