what I am trying to do is:
- having multiple images in the screens, which will be acting as buttons.
- when a finger touch the screen and hover any image (any button), the image will be changed to another one(It will look like a hover button).
- when he hover another one, the same will happen and the previous one will return to its state.
I tried to track that using OnTouchListener and didn’t work. Then, I read about Motionevent and I think it might help but I didn’t know for sure if it will.
Any one can answer or suggest a way to do this?
——————————————————
UPDATE
I tried this, but it seems not working. This is for img1 The same code will be for img2:
img1.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
while(true){
if(event.getAction()== MotionEvent.ACTION_OUTSIDE)
img1.setImageResource(R.drawable.img); //default image
else
img1.setImageResource(R.drawable.img_pressed);
}
}
});
To those who might be interested:
I couldn’t find a solution to my problem under my target devices’ level (API level 4). So, I gave up !