listener

android Service needs to handle connection failure - how?

I've got an app that retrieves data on a regular basis from the internet (3 times a week). The data on the server is available via an XML api (which I built) and which works without any problem. However, some of the users handsets are not on/connected when the call is made. What is the best way to handle this lack of net connection fa...

Google map not firing nested listener

Using Google Maps v3, I'm trying to do the following: Create a new bounds object and fit the map to this. Wait 400ms before panning to one of the LatLngs that forms this bounds object. Wait 400ms before zooming to a new level on this new centre. In doing this I have no problem with the first 2 points above. However, I can't get the l...

Creating a Doctrine behavior: How to access actAs() params from within a listener object

I'm creating a behavior (one template and one listener). In the template class, I'm using the addListener() method to attach the listener to the model. // Inside the template's setTableDefinition() method $this->addListener(new RemoraSaveListener); Pretty standard stuff, it seems. From within the listener, how to I access the templa...

Do I need to bother deregistering my phone state change listener if it's tied to a service and the service terminates?

The situation is that I have my listener constructed using an anonymous inner class, as is typical, but the way of deregistering a [PhoneStateListener][1] in Android requires me to pass the listener object to the this same function that I used to register it, but use the LISTEN_NONE flag. The problem is that I can't do this with an anony...

How to redirect request from Phase Listener to another servlet?

Hi everyone How to redirect request from Phase Listener to another servlet on remote machine and get responce back? ...

AS3 Specify if there are unvisible displayObjects with active listeners

Is there any way to count (specify) the avarage amount of objects that are removed from stage and has active listeners? I have really big project(game), more than 100 classes.. Now i scan each classes, if there are active unnecessary listeners i remove them. Now, i wanna such a tool, which will tell me where is there any other unnecessa...

How to connect 2 different spinners altogether

Hi guys, I am trying to connect 2 spinners together. Meaning, the items inside 2nd spinner will depend on whatever item is chosen for the 1st spinner. This is the code inside the main java file. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Spinner spinner = (Spin...

Scala Listener/Observer

Typically, in Java, when I've got an object who's providing some sort of notification to other objects, I'll employ the Listener/Observer pattern. Is there a more Scala-like way to do this? Should I be using this pattern in Scala, or is there something else baked into the language I should be taking advantage of? ...

What is meaning of boolean value returned from an event-handling method in Android

In android, most event listener methods return a boolean value. What is that true/false value mean ? what will it result in to the subsequence events ? class MyTouchListener implements OnTouchListener { @Override public boolean onTouch(View v, MotionEvent event) { logView.showEvent(event); return true; } } ...

android.provider.Telephony.SMS_RECEIVED not available!

I'm trying to create a new SMS receive listner. I have googled the problem and all I found was it requires android.provider.Telephony.SMS_RECEIVED but it doesnt exist in android 2.2 how to listen to new incoming messages is my question.! ...

What is the 'official' SEAM way of listening to JSF-SEAM phases?

A simple question on the title. My case is that I want to listen to "before RENDER_RESPONSE" phase, and alter some components internal state. Is PhaseListener the "right way" to do this in SEAM applications? ...

ExtJS add FormPanel global listener or solution

Hello, I'm using ExtJS 3.0 and I would like to extend FormPanel or any solution so that everytime I show a form, the first field should get focus. I was thinking of adding a global listener (if such exists) like this perhaps: afterrender: function() { Ext.getCmp('formAddProgPaymentDoc').findByType('textfield')[0].focus(); //// Get the f...

Output Debug and Trace Messages to Form

My problem is similar to one posed by Joel Coehoorn some time ago when he wanted to Redirect Trace Output to Console. In my case, I'd like to output to a ListView or TextBox or for that matter, any control which can accept text. For this purpose, I'd like to have a general purpose Trace/Debug listener which I can hook to in order to pro...

How to use Lookup listener and provider in Netbeans platform?

Hi I have a problem with understanding the Lookup Api in netbeans Platform. I want to have one module, scanning-api, where one final class will be and one interface to implement, and the application will scann pictures trough this module, and one or two modules, that will have dependency on this scanning-api module, and will implement al...

Java KeyListener not firing on JSpinner

Hi, have tried a few different approaches to this but with no success so far. Just wondered if I'm missing anything. I have a JSpinner which is a component of a DateSelector widget alongside a Calendar. I am trying to fire a validation method if the user changes any text in the JSpinner instead of using the Calendar control or the JSpinn...

Android onLoadCompleteListener how to implement?

I have a custom class called "Sound" with SoundPool, I want to implement the loading complete listener so that my activity can play an intro sound and display the "start" button once loading is complete. How would I go about implementing the listener and then testing for the complete status from my activity to make sure everything is lo...

Document Listener firing some times but not others...

Hi, this one has been puzzling me for a few days now and I feel that I have barely been able to narrow it down. I am using Java and have a wizard for the user to step through. One of the steps allows the user to select a start time & date and an end time & date to schedule some work. I thought I had the validation on the dates complete...

Read sensors while screen is black

Hi here there is a interesting problem! I have this service: public class SensorService extends Service implements SensorEventListener { private static final String TAG = "MyService"; private MyServiceBinder myServiceBinder = new MyServiceBinder(); private SensorManager mSensorManager; ........... private PowerManager.WakeLoc...

How can I detect when new windows are opened and/or get a list of open windows?

I am aware of WindowListener and its ilk, but these only seem to provide events for windows to which you have a reference already and can add the listener to. I'm wondering how to either receive a callback when new windows are created by other processes, or poll for a list of all windows currently open on the system. I'm using J2SE on ...

Issue with JMS Listener in Sun Java App Server

Hi, I am running a listener program on a JMS queue hosted in Sun Java System Application Server 9.1_02 (build b08-p03) After receiving a message I will extract and log some details in to a log file. I observed that when running listener for really long hours, it stops receiving messages. I had to manually stop the program and start it...