handler

How to call a method after a delay

I want to be able to call the following method after a specified delay. In objective c there was something like: [self.performSelectorAfterDelay @selector(DoSomething) withObject:nil afterDelay:5]; Is there an equivalent of this method in java? For example I need to be able to call a method after 5 seconds. public void DoSomething()...

Tornado handler thinks POST is missing argument when Firebug shows the argument being sent.

I have a simple form using a POST method, consisting of a text box and a file. After hitting submit, I can see the post in Firebug as follows: Parts multipart/form-data posttext Some text image BlahJFIFBlahExifBlahPhotoshopBlahBinaryStuff etc... The Tornado handler that receives it looks like: class NewPostHandler(BaseHand...

How to create Handler

Add next changes: Emily::oSeMac^ Terminal; Emily::AsyncSocketController^ _socketManager; delegate void DataArrival(String^, array<unsigned char, 1>^, System::Net::IPEndPoint^); void _socketManager_onDataArrival(String^ SocketID, array<unsigned char, 1>^ SocketData, System::Net::IPEndPoint^ RemoteIP) { System::Ob...

Best way to update an Android widget every 20-30 secs: Handler, Service or Alarm?

I have a 4x4 widget and i want to update a little piece of it every 15-20 seconds. Clearly i don't want it to be updated when the phone is in standby. The widget needs also to respond to some system events other than my timer. So, which is the best option? An AlarmManager: nice but probably cpu intensive if it needs to be run every 20 ...

Android - Timed UI events (with pause/resume)

I am looking to create timed events which trigger UI changes (like a Toast) on Android. I already know you can do this with a Handler object's postDelayed(runnable, timeDelay) method (see this page for a great example). Here is the twist: I also need to be able to pause and resume the countdown for these events. So when a user pauses th...

Applying jQuery event handlers to AJAX content

I'm sure this is something that AJAX gurus learn very early on, but this is the first time I've run into it. Using jQuery, I have assigned .click() handlers to certain CSS classes. However, if I reload some of the content via AJAX, the .click() handlers are not firing for that content. It seems I have two choices: put my .click() ha...

javascript setting custom error handler to 3rd party plugins or modules.

Hi, I am trying to set a custom error handler for 3rd party plugins/modules in my core library, but somehow, myHandler does not alert the e.message. Can somebody help me please? thank you Function.prototype.setErrorHandler = function(f) { if (!f) { throw new Error('No function provided.'); } var that = this; var g = function() { ...

Android app always stops unexpectedly, trying to do event handler?

So every time I run this code my Android app stops unexpectdly, and i dont get why... import android.app.Activity; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.Button; import android.widget.TextView; public class TheStupidTest exten...

RuntimeException from Google Analytics for Android "sending message to a handler on a dead thread"

I am using Google Analytics for Android to track events, page views on an Android app. When calling the tracker's dispatch method, I receive a RuntimeException: 07-12 18:02:05.594: WARN/MessageQueue(12823): Handler{44a08620} sending message to a Handler on a dead thread 07-12 18:02:05.594: WARN/MessageQueue(12823): java.lang.RuntimeExce...

MIME handler for Internet Explorer

I want to have an equivalent of NPAPI plugin for Firefox (or just any other sane browser). Generally I need IE to start my own program in response to object tag and let it draw the content itself. Where do I start? I tried to look it up on MSDN http://msdn.microsoft.com/en-us/library/aa902517.aspx but could not find anything suitable...

How does Smarty work when I define my Cache Function Handler?

I am trying to use my Smarty Cache Handler Function. At the beginning, I use the same example function that is posted in the Smarty manual. function mysql_cache_handler($action, &$smarty_obj, &$cache_content, $tpl_file=null, $cache_id=null, $compile_id=null, $exp_time=null); The problem is that, when I try to do $sma...

Query regarding handlers in Android

Hi All, In my application, I have two different activities and both are list activities. I use a SimpleAdapter for each activity and each adapter binds to an arraylist during the onCreate. Both arraylists are present in a different class. Now if there is any change in the arraylists, I have to notify the corresponding activity. I curre...

Android : CalledFromWrongThreadException;: Only the original thread that created a view hierarchy can touch its views

I have an issue with the following error in Android: CalledFromWrongThreadException;: Only the original thread that created a view hierarchy can touch its views It appears to happen when I try to update a Textview in my Activity, the call to update the TextView is from within my Activity but I still get the above error. I have...

How would I implement a handler here?

Hey guys, I've got 2 classes GLLayer and GLCamTest. I'm attempting to run a method located in GLCamTest... public Bitmap extractimage(int pos){ LocationData tweets; tweets = new LocationData(this); SQLiteDatabase db = tweets.getWritableDatabase(); //select the data String query = "SELECT * FROM tweets;"; ...

Programatically invoking the default application for a filetype

On a related note to this question, say I've got an file with an handler defined, how would I programatically invoke the registered handler? Don't necessarily need the actual code to do this, just a pointer to some docs or the terminology to google for this. Thanks, Chris ...

Looper behavior after destroying an activity

What happens to pending Runnables that were posted to the looper using handler.post() 1) after the activity is finished? 2) What about after it's destroyed but not finished (eg. destroyed to free up memory while paused)? ...

Sharing handlers and backing beans

Hi All, I am wondering if it is possible to have a JSF handler and some of the backing beans in a war that is shared. I say war because I have a jsp which has a handler and backing beans that are shared between different applications, and need to be called by 2 different war files. From my earlier investigation I found that it is not p...

Image handler page...

Hi all, I created an image handler page which retrieves the physical path of an image on the local machine and then using filestream, resizes and displays it - using a integer (record id) passed as querystring. What is happening is that, when the routine in pageload cannot find an image relating to the record id, it displays random ima...

How do I catch ALL program aborting errors on iPhone?

I've written an unhandled error module for my iPhone app, but for some reason some errors are managing to bypass it. I have an exception handler and the following signal handlers set: NSSetUncaughtExceptionHandler(&handleException); signal(SIGILL, handleSignal); signal(SIGABRT, handleSignal); signal(SIGFPE, handleSignal); signal(SIGBUS...

Is there a better way of manipulating SOAP messages than Jaxws SOAP Handler Interceptor before the message gets to the container?

I am currently using the jaxws and apache CXF framework to create webservices using the top down approach. I am using the SOAP interceptors to add remove SOAP header elements, using SAAJ, before the message gets to the container, and the container maps the SOAP action too the java method. I am doing this to create Security Token Serv...