Code example for View

Methods: setOnGenericMotionListener

		super(activity, context, view, config);
		// we hook into View, for LWPs we call onTouch below directly from 
		// within the AndroidLivewallpaperEngine#onTouchEvent() method. 
		if (view instanceof View) {
			View v = (View)view;
	public boolean onGenericMotion (View view, MotionEvent event) {
		for (int i = 0, n = genericMotionListeners.size(); i < n; i++)
			if (genericMotionListeners.get(i).onGenericMotion(view, event)) return true;
		return false; 
	public void addGenericMotionListener (OnGenericMotionListener listener) {
Experience pair programming with AI  Get Codota for Java