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
1 answer

How to drag a whole activity-layout and treat the drag as a back-button in Android?

I want to implement an Android-Application like gallery or photos. I have several small photos. When I click on a photo, I open another activity which displays the foto over the whole screen. I want to be able to drag the activity to the bottom and…
0
votes
1 answer

How to get id of the item clicked from layout action in android?

I am validating the EditText value by clicking anywhere inside the window. But for some buttons, I want to do something different from the validation functionality. How can I get the id of the item from the layout action. Here my layout is…
Malhotra
  • 221
  • 3
  • 13
0
votes
2 answers

How to disable Settings button of input fields in KIOSK mode

I want to how is possible to disable Settings button of input fields in KIOSK mode ? I have read the KNOX and KIOS official doc and searched on Stackoverflow, but was not able to find a working solution.
0
votes
0 answers

there is no default constructor available in Conferenceable

I'm a beginner for android. I want to develop an app for the detection of conference call. so in this line, I faced there is no default constructor available android.telecom.Conferenceable. import android.telecom.Conferenceable; import…
user10993489
0
votes
1 answer

Event Bus Subscrided event not calling

I used the following code to communicate between the fragments of Tablayout. Produces the following error. No subscribers registered for event class MessageEvent D/EventBus: No subscribers registered for event…
Swamy
  • 65
  • 7
0
votes
0 answers

Class name doesn't reside within package name (from AccessibilityEvent)

I am working on an android service that tracks window state changes on a device. Each event is logged, including the reported package name and class name that triggered the event. I noticed that some events have a className that doesn't reside…
0
votes
0 answers

Refactoring Suggestion for PagerAdapter implements View.OnClickListener

I have the following code but I'd like to consolidate the View.OnClickListener objects into one function by implementing View.OnClickListener. But When the position of the page keeps changing when the click event happens. Before refactoring my code…
g_studio
  • 43
  • 6
0
votes
1 answer

Right and Left click on ViewPager

How do i detect if i have clicked or press at right side of viewPager or at left side of viewPager. I have tried with GestureDetector but couldn't make it out. Help me
0
votes
1 answer

Make ImageView appear when RecyclerView is longpressed and disappear when released?

I would like to create a RecyclerView in which a user can long click an image and preview the full sized image until they release the long click. I have it mostly working but the issue I am having is that if I begin the long click, then drag my…
Isaac Perez
  • 570
  • 2
  • 15
  • 31
0
votes
1 answer

How to use EventBus in two Activity on Android

In my application i want use EventBus for manage events. In my app i open activity B on the Activity A ! and i want when activity B finished, call one event in Activity A. I write below codes Activity B : private void finishWithAnimate() { …
Jungle
  • 247
  • 5
  • 16
0
votes
1 answer

multiple fragments and activity all responding to button click in activity

I have a multi-fragment form dividing sections of a form. When the user is finished they hit the submit button at the bottom of the screen which is owned by the hosting activity. When the user clicks submit all the fragments should send their data…
user9952186
0
votes
1 answer

ACTION_UP does not recognize after Action_DOWN

In my project i need to use the onTouchListener in order for me to know when the user touch\don't touch specific buttons and send data to my server in both cases. the code: private View.OnTouchListener handleTouch = new View.OnTouchListener()…
0
votes
0 answers

Not receiving data sent to the server after ACTION_DOWN event

the problem is that i only recieve the data that sent from the client to the server after hitting the imagebutton and the event was action down. i found out that the checking on event_up never send the data - the if never happanes. the part of the…
Ido
  • 55
  • 7
0
votes
1 answer

How to translate event driven code?

I'm mostly C# developer and I'm recently working on some Android project. I have to implement some custom written events in Android, but I'm not sure how to do that. I wrote a C# code for what I want to do, so if anyone can help me with translating…
delux
  • 1,694
  • 10
  • 33
  • 64
0
votes
1 answer

NumberPicker, OnValueChangedListener, distinguish change from user and from programmatic change?

It seems that OnValueChangedListener is called when the value is changed programmatically by the app itself. Can I make it raised only when the user rotates the dial or know whether the event is from the app (code) or from the user?
Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135