Siddharth Siddharth - 3 months ago 10
Android Question

How to create an overlay canvas with propagation of touch events to the home screen?

For the life of me, I cannot figure out anything about this topic. Maybe I'm just not using the correct keywords while searching.

What I'm trying to do is create an overlay transparent canvas which will basically pass on all touch events to the Android home screen, in effect, making the phone completely usable.

If I'm not making sense, please have a look at the "Transparent Screen" application on the Android Market. That is exactly what I want to do. The camera preview screen is always on top while the phone can be used normally. How can I achieve this?

Answer

Got it! Just use this in the activity:

getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);

It creates a click-through activity.