title: Only one method to implement onTouchListener() to multiple buttons
body: <p>I'm trying to use just one onTouchListener() for multiple buttons and this is the code i have,but its not working. 
  What i want to do is when i press the button up,if there is another button pressed(right or left) to write a code and if its not pressed another button to write another code. I'm pretty new to java so there might be a lot of mistakes.
  If you have another solution for my problem please help!</p>
  
  <pre><code> abstract class MyTouchListener implements View.OnTouchListener{
  
         public boolean OnTouch(View v,MotionEvent event){
             switch (v.getId()){
                 case R.id.btnup:
                     switch (v.getId()){
                         case R.id.btnright:
                             mBluetooth.write("#1001#");
                             break;
                         case R.id.btnleft:
                             mBluetooth.write("#1002#");
                             break;
                         case R.id.btnup:
                             mBluetooth.write("#1000#");
                             break;
                     }
                     break;
                 case R.id.btnright:
                     mBluetooth.write("#0002#");
                     break;
                 case R.id.btnleft:
                     mBluetooth.write("#0001#");
                     break;
                 case R.id.btndown:
                     switch (v.getId()){
                         case R.id.btnright:
                             mBluetooth.write("#2001#");
                             break;
                         case R.id.btnleft:
                             mBluetooth.write("#2002#");
                             break;
                         case R.id.btndown:
                             mBluetooth.write("#2000#");
                             break;
                     }
  
  
             }
        return true; }
     }}
  </code></pre>
  
  <p>This are the buttons:</p>
  
  <pre><code>    btnup=(Button)findViewById(R.id.btnup);
      btndown=(Button)findViewById(R.id.btndown);
      btnleft=(Button)findViewById(R.id.btnleft);
      btnright=(Button)findViewById(R.id.btnright);
  
  
  
       MyTouchListener touchListener = new MyTouchListener();
      btnup.setOnTouchListener(touchListener);
  </code></pre>