3

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.

Venks88
  • 73
  • 6
  • Did anyone have a solution for this? – Venks88 Feb 06 '13 at 13:22
  • hi, I am checking this feature, too. and IMHO, Presentation probably should not be used this way. in real scenario (not the simulator), there probably be no input event s from the "second display". – Henry Feb 19 '13 at 07:03
  • There is possibility that the second display may introduce input events.... – rk_P Mar 25 '14 at 09:34

1 Answers1

0

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

rk_P
  • 230
  • 1
  • 3
  • 12