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

App crashes immediately after I added SeekBar change listner

Hi I am a total newb to Android Development and I have been banging my head against the wall about this for weeks. Basically I have a SeekBar and I want to have it do something whenever the SeekBar moves. I tried to set up an onSeekBarChange event…
1
vote
1 answer

How to Listen Android keyboard Close Event after Typing finished in EditText?

I referred this link to listen the android EditText finish typing event. But from this reference i am getting the Enter key pressed event only. I need to listen an event when user closes keybord after finishing the typing and also when user presses…
1
vote
1 answer

How to find Events of Calender between two dates in android

As i am new in Android, i have to make an android app which can find the events list between two dates like: 23-02-14 to 24-02-14. I am not getting those events which i have added manually on calender like birthday of my friend, it shows the whole…
SanjuBaba
  • 37
  • 11
1
vote
1 answer

Listview - onClickListener's onClick called on reused view

I have list view and every row has multiple clickable areas. In bindView(I use CursorAdapter) I set onClickListener for every clickable area and everything works fine. Problem occurs when I click on view and at the same time notifyDataSetChanged is…
1
vote
1 answer

Android: Recurring reminder, before and after time

I am developing an application in which I am setting reminder programmatically. The code of setting reminder is as follows : private void addReminder(int statrYear, int startMonth, int startDay, int startHour, int startMinut, String title){ //…
1
vote
2 answers

Strange KeyDown behavior while implementing Menu

I am trying to add a menu to my GDK app. I am using an immersion and followed the instructions here: https://developers.google.com/glass/develop/gdk/ui/immersion-menus Everything compiles ok, but the actual options menu doesn't work. When I tap on…
calumb
  • 1,051
  • 2
  • 10
  • 24
1
vote
2 answers

android app not registering onTouch

This is my layout file
learner
  • 11,490
  • 26
  • 97
  • 169
1
vote
1 answer

How to handle Listview both setOnItemClickListener and setOnItemLongClickListener android

i have an issues list view onItemclick and onitemLongclick event handling , i have try diffrent way but am not able to fix this issues , i have refred This link. plz help me.
venu
  • 2,971
  • 6
  • 40
  • 59
1
vote
1 answer

How to read events from google accounts calendar in android?

I am reading the calendar events in android but i want to read the events for google accounts calendar events .How is it possible? Could any suggest me or help me out of this? The below code is working fine and its getting only the android calendar…
user2841300
  • 353
  • 1
  • 7
  • 23
1
vote
4 answers

How to detect if click event is finished in android?

I create views dynamically, and I handle their click events normally, like this : myView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub …
1
vote
1 answer

Proper usage of Activity Life Cycle Events

I have two Activities, namely MainActivity and Favorites. On the MainActivity, I have something like this: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //function to insert data to database …
ajdeguzman
  • 1,223
  • 3
  • 16
  • 27
1
vote
2 answers

Android Calendar timezone not changing with CalendarContract

I am using the following code to add an event to the calender Intent intent = new Intent(Intent.ACTION_INSERT); intent.setType("vnd.android.cursor.item/event"); intent.putExtra(Events.TITLE, "my event title"); …
revolutionary
  • 3,314
  • 4
  • 36
  • 53
1
vote
1 answer

Press back button current fragment persist not restore previous fragment

I have Fragment Activity which contains a Framelayout for fragment transition. A fragment named LeadActiviy extends SherlockListFragment contains Asynctask, in AsyncTask's method onPostExcute contents else block statement. In else block current…
Vishwajeet
  • 45
  • 7
1
vote
1 answer

How can I slide a vertical SeekBar in a ScrollView

I've made a vertical SeekBar by overriding the onDraw method and flipping it 90 degrees. Now I need to put this in a ScrollView. The actual layout structure is ...
dumazy
  • 13,857
  • 12
  • 66
  • 113
1
vote
1 answer

Get different events on setCompoundDrawables with differnet drawables

I have an EditText in which I'm setting drawables to the right of the EditText. I'm switching those drawables with different scenarios. I have clearText and refreshIcon as my drawables. These both are changing correctly but I'm not able to get…