Questions tagged [android-event]

On Android, there's more than one way to intercept the events from a user's interaction with your application. When considering events within your user interface, the approach is to capture the events from the specific View object that the user interacts with. The View class provides the means to do so. Questions that regard doubt about any type of events action (listeners and handlers), should use this tag to express themselves.

Within the various View classes that you'll use to compose your layout, you may notice several public callback methods that look useful for UI events. These methods are called by the Android framework when the respective action occurs on that object. For instance, when a View (such as a Button) is touched, the onTouchEvent() method is called on that object. However, in order to intercept this, you must extend the class and override the method. However, extending every View object in order to handle such an event would not be practical. This is why the View class also contains a collection of nested interfaces with callbacks that you can much more easily define. These interfaces, called event listeners, are your ticket to capturing the user interaction with your UI.

While you will more commonly use the event listeners to listen for user interaction, there may come a time when you do want to extend a View class, in order to build a custom component. Perhaps you want to extend the Button class to make something more fancy. In this case, you'll be able to define the default event behaviors for your class using the class event handlers.

For a more detailed information you can visit Google oficial webpage about Events at Google Developer - Events

318 questions
0
votes
0 answers

How to decrease sensitivity of onTouch?

How to decrease sensitivity of onTouch ? I have a custom remote with a virtual touch pad on it. The problem is that when I move finger over the touch pad the mouse cursor moves very fast. So is there a way to decrease that movement speed ? I have…
abrutsze
  • 496
  • 1
  • 8
  • 24
0
votes
0 answers

Android: how to do background clickable effect by programmatically?

I have a background for button.
Greed Ruler
  • 169
  • 2
  • 14
0
votes
1 answer

Intercept click/touch event without overriding ViewGroup or View methods

Is there any way how can I intercept/decorate view's touch event without extending View or wrapping in some ViewGroup (which can intercept child events)? Suppose I have ExpandableListView which handles item click events. If I set in adapter…
matoni
  • 2,479
  • 21
  • 39
0
votes
1 answer

How to get row selection event and item click event in custom adapter listview all together in Android

I have custom list of two text views having different text string. These are items in the list. In current scenerio I can only register the setOnItemClickListener for the list. This is triggered when the item in the list is clicked. If I click on…
0
votes
1 answer

Logging out on one android flavor logs out the other flavor too on same device

I have built two different flavors of the same app, while running on the same device If I logout from one app it logs out the other app as well. In my app Logout is a network call so when I click one logout button I can see network calls for both…
pradex
  • 328
  • 4
  • 18
0
votes
2 answers

Get events added by my app in android calendar

In my app, I am adding some event in the google calendar on a screen. When the user comes to the screen again, it adds the events again so in calendar the duplicate event is also visible. So before adding any new event, I want to check if the event…
The Bat
  • 1,085
  • 1
  • 13
  • 31
0
votes
0 answers

.equals() not working with Emojicons for Android

I am creating a Android application in Android Studio. The screen displays an ImageView that generates a random emojicon (I used an array). A keyboard (3rd-party keyboard implemented) then pops up and a user must find that same emojicon. Once the…
MSP
  • 89
  • 1
  • 2
  • 10
0
votes
3 answers

How can i use OnLongClick Listener on more than 1 buttons in a onLongClick Method in same class

Here is my Code ... protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); text = (TextView) findViewById(R.id.textView); …
0
votes
1 answer

How to capture user level interactive events on Android and iOS

There is Google Analytics, Firebase and loads of other analytic services which can capture the user events on mobile hardware and send it to an online dashboard. But AFAIK, none of these services log the events against each user i.e. although i will…
Dibzmania
  • 1,934
  • 1
  • 15
  • 32
0
votes
1 answer
0
votes
0 answers

Touch a group or row of buttons android

First of all, English is not my first language but I will try my best. I'm new to Android. How to discover three or four touch buttons with one finger or one touch as shown in the picture? I created RelativeLayout containing buttons, @Override…
0
votes
3 answers

How to add long click listener to multitouch gesture detection library

The sample application (shown below with my additions) is included in the Almeros library. It allows the user to perform multi-touch gestures to move, size, rotate, and shove an object on an unchanging background: I would like to implement a long…
0
votes
1 answer

Android: replacing text in activity after click event on fragment button

I got lots of NPEs and was wondering how you manage this common task. There is a button in my fragment, here the WelcomeFragment. The button will clicked and the event is handled in the MainActivity class. The fragment is a NPE, the view, too…
Jochen
  • 1,746
  • 4
  • 22
  • 48
0
votes
2 answers

Android - Greenrobot EventBus in android?

I am using from greenrobot:eventbus in my project: compile 'org.greenrobot:eventbus:3.0.0' Problem : I am using from EventBus for GPS like bellow : public class ConditionGPS { public static void statusCheck(Activity activity) { final…
0
votes
1 answer

android soft keyboard: onReceiveResult fire with RESULT_SHOWN following immediately by RESULT_HIDDEN

I want to detect when the soft keyboard is show and hidden. For this i do like this : public class ALEditText extends EditText { private ALSoftInputListener mSoftInputListener; private static class SoftInputReceiver extends ResultReceiver { …
zeus
  • 12,173
  • 9
  • 63
  • 184