我有一个活动1里面有一个的EditText。我想打开另一个活动活性2当上了的EditText用户双击。
I have an "Activity1" which has an "EditText". I want to open another activity "Activity2" when the user Double clicks on the "EditText".
使用这样的:
final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
public boolean onDoubleTap(MotionEvent e) {
Log.e("", "Open new activty here");
return true;
}
});
TextView tv = (TextView) findViewById(R.id.editTextID);
tv.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
return gestureDetector.onTouchEvent(event);
}
});
上一篇:Android开发RecoverySystem.installPackage()无法写入否认/缓存/恢复/命令的权限缓存、命令、权限、Android
下一篇:我需要 Dispose() 或 Close() 一个 EventWaitHandle 吗?Dispose、Close、EventWaitHandle