简体   繁体   English

我想在一个活动中调用MotionEvent.ACTION_DOWN,在另一个活动中调用MotionEvent.ACTION_UP

[英]i want call MotionEvent.ACTION_DOWN in one activity and MotionEvent.ACTION_UP in another activity

 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. 当我触摸图像'ii'时我应该去imgview(i2)(也可以是活动)当我离开imgview应该消失(回到相同的活动)..(注意:imgview覆盖手机全屏)我不知道......如何继续。

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 有关这方面的信息,请查看Android - 来自其他活动的整理活动

Also, take a look at the Notepad Tutorial , for a complete example. 另外,请查看记事本教程 ,以获取完整示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不调用MotionEvent.ACTION_UP - MotionEvent.ACTION_UP is not called MotionEvent.ACTION_DOWN在Android中不起作用 - MotionEvent.ACTION_DOWN Not Working In Android 没有显示MotionEvent.ACTION_UP或MotionEvent.ACTION_CANCEL - not showing MotionEvent.ACTION_UP or MotionEvent.ACTION_CANCEL Android MotionEvent.ACTION_MOVE和MotionEvent.ACTION_UP - Android MotionEvent.ACTION_MOVE and MotionEvent.ACTION_UP 检查MotionEvent.ACTION_UP是否超出imageview - Check if MotionEvent.ACTION_UP is out of the imageview 在ACTION_DOWN中启动后,CountDownTimer在MotionEvent.ACTION_UP上未取消 - CountDownTimer not cancelled on MotionEvent.ACTION_UP after starting it in ACTION_DOWN 使用OnTouchListener,MotionEvent.ACTION_UP时,应用程序意外停止 - App stops unexpectedly when using OnTouchListener, MotionEvent.ACTION_UP 当我调用事件时,onTouchEvent的ACTION_DOWN MotionEvent中的代码引发异常 - code within onTouchEvent's ACTION_DOWN MotionEvent throws exception when i call the event AndroidStudio MotionEvent:仅在第二个视图上检测到ACTION_UP,在第一个视图上启动ACTION_DOWN - AndroidStudio MotionEvent: detect only ACTION_UP on a second view, starting ACTION_DOWN on first view MotionEvent-Java中的action_move(监听action_up) - MotionEvent - action_move (listening for action_up) in java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM