android - Gather Touches from MainActivity -


i want gather possible touches entire screen. implemented a

@override    public boolean ontouchevent(motionevent e)     {        double x = e.getx();        double y = e.gety();     } 

but added tableview "scene" , when click on above method not being called because tableview swallowing touches. http://i.gyazo.com/d671768c45a0d9576d6ba3b822dfa85d.png

everything around yellow area clickable yellow area not. want clickable well, want time whole screen area clickable can store touch positions. how it?

edit: ontouchevent method in mainactivity class. here activity_main.xml

<linearlayout         xmlns:android="http://schemas.android.com/apk/res/android"         android:id="@+id/linearlayout1"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:orientation="vertical">      <scrollview         android:layout_width="match_parent"         android:layout_height="match_parent" >          <tablelayout             android:id="@+id/tablelayout1"             android:layout_width="match_parent"             android:layout_height="match_parent"             android:padding="10dp"             android:shrinkcolumns="*"             android:stretchcolumns="*" >              <tablerow android:layout_height="wrap_content">                 <textview                     android:id="@+id/column1"                     android:text="tapcount"                     android:layout_height="wrap_content"                     />             </tablerow>          </tablelayout>     </scrollview>     </linearlayout> 

cover whole view own transparent, this:

<relativelayout>     <linearlayout         android:layout_height="fill_parent"         android:layout_width="fill_parent">             <!--your content inside-->     </linearlayout>     <view         android:id="@+id/cover"         android:layout_height="fill_parent"         android:layout_width="fill_parent"/> </relativelayout> 

then use code view id=cover , return false in ontouchevent in doc:

returns true if event handled, false otherwise.

with false hardcoded motionevent delivered views below/under


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -