I am developing an android application, which displays some unique content on secondary display. Presentation class is newly introduced in Jelly Bean Plus(4.2.1). It is a special kind of dialog whose purpose is to present content on a secondary display I am testing my application using secondary displays simulator which can be opened from settings - developer options Now I would like to intercept touch events on secondary display. Have a look at my presention class
public class NewPresentation extends Presentation {
public NewPresentation(Context outerContext, Display display) {
super(outerContext, display);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.notes_preview);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
return super.onTouchEvent(event);
}
}
But this onTouchEvent is not firing, when I touch somewhere on the secondary display.
I doubt that, as Presentation extends Dialog, which cannot intercept touch events(not sure), so does Presentation class
Is there any way to make Presentation class to intercept touch events? Please help me.
As Presentation class is extends to Dialog, and dialog itself is clickable you can have touch events from your presentation class. I tried sample app on device having secondary display and touch input enabled and it worked. Your secondary display may be dont to have touch support