erdomester
erdomester

Reputation: 11829

Android Button press strength

Is there an example about how to measure the strength of pressing the screen? I know there is a command, i just cant find it.

Upvotes: 3

Views: 567

Answers (1)

gatnowurry
gatnowurry

Reputation: 344

The method is android.view.MotionEvent.getPressure().

You can also fetch the size of the touch with MotionEvent.getSize(). Beware though, most models have different screens and will behave differently.

EDIT: It also doesn't seem to work with WebView.

Upvotes: 3

Related Questions