Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - onTouch() not working properly, HTC Magic

onTouch() not working properly, HTC Magic

Put your problem here if it does not fit any of the other categories.

onTouch() not working properly, HTC Magic

Postby kikoso » Wed Dec 02, 2009 6:55 pm

Hi there :-),

I'm trying to develop a touch control, but I'm getting some problems with the onTouch method. Basically, only the event ACTION_DOWN is working. The others seems to be in trouble. My application has a LinearLayout, containing a VideoView.

I have a HTC Magic updated to 1.6. With a basic code like this one:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public boolean onTouch(View v, MotionEvent event) {
  2.  
  3.                 // TODO Auto-generated method stub
  4.  
  5.                   int action = event.getAction();
  6.  
  7.                     switch (action) {
  8.  
  9.                       case MotionEvent.ACTION_DOWN:
  10.  
  11.                         return false;
  12.  
  13.                       case MotionEvent.ACTION_MOVE:
  14.  
  15.                         return true;
  16.  
  17.                       case MotionEvent.ACTION_UP:
  18.  
  19.                           return true;                   
  20.  
  21.                       case MotionEvent.ACTION_CANCEL:
  22.  
  23.                           return false;
  24.  
  25.                       case MotionEvent.ACTION_OUTSIDE:
  26.  
  27.                           return false;
  28.  
  29.                       default:    
  30.  
  31.                     }
  32.  
  33.                 return false;
  34.  
  35.         }
  36.  
  37.  
Parsed in 0.011 seconds, using GeSHi 1.0.8.4

I always enter into the first case. I've been googling and trying to find a response for it. I added the following permision lines to the manifest.

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
  2.  
  3.         <uses-permission android:name="android.permission.BIND_INPUT_METHOD" />
  4.  
  5.         <uses-permission android:name="android.permission.HARDWARE_TEST" />
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


Hope someone can give some useful hints. Thank you in advance, and regards,

Enrique
kikoso
Freshman
Freshman
 
Posts: 6
Joined: Thu Nov 12, 2009 11:41 am

Top

Postby kikoso » Wed Dec 02, 2009 8:24 pm

So, finally solved it.

Post the solution here, in case anyone have the same problem. The following section of the code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. case MotionEvent.ACTION_DOWN:
  2.  
  3.                   return false;
Parsed in 0.010 seconds, using GeSHi 1.0.8.4


Should return true, instead of false. By doing this the other statements are reached.

Enrique
kikoso
Freshman
Freshman
 
Posts: 6
Joined: Thu Nov 12, 2009 11:41 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 9 guests