• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps get touch position when app is in background

Sorry, I only know how to do it overriding the onclickevent.

@Overridepublicboolean onTouchEvent(MotionEventevent){int x =(int)event.getX();int y =(int)event.getY();switch(event.getAction()){caseMotionEvent.ACTION_DOWN:caseMotionEvent.ACTION_MOVE:caseMotionEvent.ACTION_UP:}returnfalse;}
 
I dont think its possible. Services are basically used for notification purposes and all. You can get touch position tll the time app is in running state.
 
Back
Top Bottom