Search Results

Search found 2 results on 1 pages for 'normano'.

Page 1/1 | 1 

  • Android - Enter button with finger detection?

    - by Normano
    Hello, I'm working on a soundboard, however I've got a problem when it come to drag the finger over the screen to play the sounds for the buttons I drag the finger over. Button Button3 = (Button)findViewById(R.id.button03); Button3.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if(event.getAction() == MotionEvent.ACTION_DOWN){ mp.playSound(3); } return false; } }); Do anyone know how I can detect when a finger enter a button and not click the button? THanks :)

    Read the article

  • Android - Array or for statement problem

    - by Normano
    I making on a app, but I have a problem with for or with a array. When I use this code case MotionEvent.ACTION_MOVE: for (int i = 0; i < Button.length; i++) { if (Y > Button[i].getTop()+25 && Y < Button[i].getBottom()+25 && X > Button[i].getLeft() && X < Button[i].getRight()){ LastButton = i; edittext.setText("id " + i); } } break; But the for statement skip the first button in the array and the second button get id 1. anyone know how I can fix it? Thanks

    Read the article

1