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
3 answers

Android Event Handling

Which type of model is used by android to handle events. Is it delegation model or event model?
Sunil
  • 856
  • 12
  • 24
0
votes
4 answers

OnClick event is not firing in popup in android

I have made a custom popup in an app where the layout of the popup is as follows:
Shehabic
  • 6,787
  • 9
  • 52
  • 93
0
votes
2 answers

OnTouchEvent does not work on Edittext field, is there an alternative?

I have a edittext field which prefilled with the value "comment please..." Now I want to delete this content as soon as the User touches this field. In the documentation I saw that there is the possibility to add an onTouchEvent to a edittext field.…
Al Phaba
  • 6,545
  • 12
  • 51
  • 83
0
votes
1 answer

Which listener to use to implement selection of multiple views by sliding the finger over them?

I am confused about what I should use to listen for the event of sliding the finger across views and selecting those views. Is this a hover event? Android doc says The hover may be generated via exploring the screen by touch or via a pointing…
Limbo Exile
  • 1,321
  • 2
  • 21
  • 41
0
votes
3 answers

Android SDK - Animation prevents further events on View like OnClick()

I have an ImageView which is animated via startAnimation() to slide it into the screen. It is visible and enabled in the XML. When I add a Handler for a delay or an onClick event, nothing happens. When I remove the startAnimation() everything works…
Ron
  • 22,128
  • 31
  • 108
  • 206
0
votes
2 answers

OnTouch method consumes click event and prevents execution in parent

I'm having a FrameLayout that has an extended ImageView (github) as a child. When I set an onClick()-Event to the FrameLayout it won't be triggered. The reason appears to be the onTouch() method's return value. If I set the ACTION_DOWN's return…
Taig
  • 6,718
  • 4
  • 44
  • 65
0
votes
1 answer

click event on custom layout (extends LinearLayout) is not triggered in IceCream Sandwich but works on gingerbread

We have a custom layout extending linearlayout, which has a button. The button has a OnClickListener set. This Layout is added to a custom view extending ScrollView(called the grid). The onclick event on the button is recognized in gingerbread but…
0
votes
1 answer

Change in columns values when deleting an instance on an recurring event on Android

does anyone know what columns values changes on the event table when a user deletes one instance of a recurring event? I have been reading CalendarContract.EventsColumns and they talk about recurring events in the beginning, but i can't find more…
Dporem
  • 113
  • 2
  • 11
0
votes
1 answer

Dissapear And Appear Admob AdView On User Activity and InActivity Android

I have a particular scenario where I want to hide the Admob AdView when the user has tapped the screen and show again after the 1 seconds of user inactivity on the application. I have am successfully hiding the AdView and showing it again after user…
muneikh
  • 2,067
  • 5
  • 25
  • 59
0
votes
1 answer

trigger an event in another activity

is there a way trigger an event in another activity which might be below the current activity in the stack (the activity below the current activity is not a part of my application) for eg: if activity 'Act1' of application 'A' launches Activity…
Vinay W
  • 9,912
  • 8
  • 41
  • 47
0
votes
2 answers

Java check every 1hour

i build a server that sends questions to clients depending on the cells they are in, for example if they are in Rome's cell, the server will send them questions different from the questions will be sent to clients in London's cell, and when a…
William Kinaan
  • 28,059
  • 20
  • 85
  • 118
0
votes
1 answer

Android set radio button text

i have four radio buttons , and i want to set a text for each one , i get data from a server and set that data to those buttons like this: protected String[] doInBackground(String... params) { HttpClient client = new DefaultHttpClient(); …
Totti
  • 665
  • 5
  • 12
  • 26
0
votes
2 answers

How to Prevent Accidental App Exit w/in Android Fragments/Activities?

How Do I Prevent Accidental App Exit w/in Android? IE: When the he/she presses the back button and reaches the last activity in the BackStack, show a toast to ask if the user wants to exit using the onBackPressed() method. Also, It needs to function…
user742030
0
votes
4 answers

Set EditText visibility based on Spinner value

I'm trying to create this dialog: . When Spinner is set to custom value, TextEdit should automatically appear. I'm calling View.setVisible() on the TextView but the visibility is not evaluated immediately but waits to another change - e.g. adding…
krtek
  • 1,055
  • 1
  • 13
  • 28
0
votes
1 answer

How would I code a button onclick event?

Aim: To have the if statement execute a onclick event through code. I currently has this button in xml.