ImageView ii = (ImageView)v.findViewById(R.id.picture);
ii.setOnTouchListener(new OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent e) {
ImageView i2 = (ImageView)findViewById(R.id.btn_imagetest);
if(e.getAction() == MotionEvent.ACTION_DOWN){
//call activity one
}
if (e.getAction() == MotionEvent.ACTION_UP)
{
//call activity 2
}
return true;
}
});
when i touch on image 'ii' i should go to imgview(i2)(can be activity too) and when i leave the imgview should go away(back to same activitiy) ..(Note:imgview is covers full screen in phone) i have no idea..how to proceed开发者_如何学运维.
If I understand correctly, you're asking for information on how to start another Activity from the current Activity. For information on that, take a look at Android - finishing activity from another activity
Also, take a look at the Notepad Tutorial, for a complete example.
精彩评论