일부 html 데이터가있는 webview가 표시됩니다. 일부 이미지와 하이퍼 링크가 포함되어 있습니다. webview에서 이미지를 클릭하면 activity.i가 시작될 때 이미지가 감지됩니다. 난 웹 화면에서 이미지를 검출 할 수이를 이용하여Trigg 웹 뷰 안드로이드에서 이미지를 클릭하면 동작이 나타 납니까?
WebView.HitTestResult
를 사용하여 웹 뷰 난 내가 스크롤 할 때 문제가되는 영상의 검출있어 ontouchLisner에 넣고 웹보기, 실수로 이미지를 가로 질러 손가락을 움직이면 활동이 시작됩니다 ontouchLisner가이 문제를 해결할 방법이 있습니까? ty는 웹보기에서 이미지를 클릭 할 때만 트리거되어야합니다.
는이 touchlisner에 난 당신이 웹뷰에서 이미지를 클릭 할 때, 컨텍스트 메뉴를 열 필요가 내 코드wv.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
// TODO Auto-generated method stub
WebView.HitTestResult hr = ((WebView) arg0).getHitTestResult();
switch (arg1.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_UP:
if (hr.getType() == 5 || hr.getType() == 8) {
//Detect image in webview
startActivity(new
Intent(MainActivity.this,Other.class));
}
break;
case MotionEvent.ACTION_POINTER_DOWN:
Log.d("-------", "clcik.den");
case MotionEvent.ACTION_POINTER_UP:
Log.d("-------", "clcik.up");
break;
case MotionEvent.ACTION_MOVE:
Log.d("-------", "clcik.movee"+hr.getType());
break;
}
return false;
}
});