---
title: "Long press Detection in andriod"  
description: "Long press Detection in andriod"  
author: "Anonymous User"  
published: 2015-04-25  
updated: 2015-04-25  
canonical: https://www.mindstick.com/forum/23143/long-press-detection-in-andriod  
category: "android"  
tags: ["android"]  
reading_time: 1 minute  

---

# Long press Detection in andriod

I am currently using

```
onTouchEvent(MotionEvent event){}
```

\
to [detect](https://www.mindstick.com/forum/1906/detect-when-cd-drive-was-closed) when the [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) presses my glSurfaceView is there a way to detect when a [long](https://www.mindstick.com/articles/44565/white-wedding-dresses-long-prom-dresses) [click](https://www.mindstick.com/articles/12423/social-login-magento-2-one-click-to-register-social) is made. I'm guessing if I can't find much in the [dev](https://answers.mindstick.com/qa/35700/which-two-counties-did-kapil-dev-play) [docs](https://answers.mindstick.com/qa/102493/explain-the-basics-of-google-docs-for-document-creation) then it will be some sort of work around method. Something like registering ACTION_DOWN and seeing how long it is before ACTION_UP.\
How do you detect long presses on [android](https://www.mindstick.com/articles/13046/10-reasons-why-i-prefer-android-vs-iphone-ios) using [opengl](https://www.mindstick.com/interview/22936/use-of-opengl-in-ios)-es?

## Replies

### Reply by Anonymous User

```
final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {    public void onLongPress(MotionEvent e) {        Log.e("", "Longpress detected");    }});public boolean onTouchEvent(MotionEvent event) {    return gestureDetector.onTouchEvent(event);};
```


---

Original Source: https://www.mindstick.com/forum/23143/long-press-detection-in-andriod

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
