FAQ Database Discussion Community


Asynctask issue on android version < 4

android,android-asynctask,handler,android-4.0,android-2.3-gingerbread
I have developed an app to support android os 4 and above. I have used an Asynctask to make an web service call during app start up. Later I have changed my minSdkVersion to 9. To support android 2.3 and above. But the same code throws below error. Calling AsyncTask...

Download File in AJAX Handler

javascript,php,jquery,ajax,handler
I wrote a small script using only PHP to test file download functionality using a experimental API, where this worked fine. When I decided to commit this code to my project, I added the same code to the handler for my AJAX call, however it does not start the download...

onClick priority over addEventListener in javascript?

javascript,onclick,handler,addeventlistener
Right now, I have an event listener that listens to a click on the screen. There is also a button on the screen. When I click on the button the event listener will execute before the onclick. Is there a way I can make onclick have higher priority? <script> document.body.addEventListener('click',function(){alert('1');},...

NettyIO disconnect Client from Server

java,connection,handler,netty,channel
How can I disconnect a netty client from the server so it executes the handerRemoved method on the server side and completely stops running? I tried using group.shutDownGraceFully() but the client still keeps connected to the server. Is there any method I am missing? I also noticed when I try...

ISSUES with SIGCONT and waitpid() in LINUX

linux,shell,handler
I'll try to keep it simple. I'm currently replicating a shell for LINUX. I use a linked list structure "job_list" to store all background processes. If a background process is terminated, then it is removed from the list. If a background process is suspended, its status within the list is...

Android animation like domino

android,animation,handler
I wanna make animation like domino effect. but when i use animation xml and handler with for loop, it works together at the same time. how can i make the domino effect animation such as start the animation for next button(tue) 100 milliseconds after the first button(mon) started? my hanlder...

i have written my both jquery code and handler file code correctly. but value is not passing to handler file from jquery file

javascript,jquery,file-upload,c#-3.0,handler
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> $(document).ready(function () { $("#Button1").click(function (evt) { var fileUpload = $('[id$=FileUpload1]')[0].value.split(","); var data = new FormData(); for (var i = 0; i < fileUpload.length; i++) { data.append(fileUpload[i].name, fileUpload[i]); } var options = {}; options.url = "Handler.ashx"; options.type = "POST"; options.data = data; options.contentType = false; options.processData = false; options.success...

Handler & Runnable for Android Timer

java,android,handler,runnable,android-handler
I'm trying to display a String array in a TextView, one item at a time, every time an interval in milliseconds ends. I've been recommended this code: package com.tt.blanker; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.widget.Button; import android.widget.TextView; import java.util.StringTokenizer; /** * Created by Gonzalo on 08/04/2015....

Using Linq to Sql join in generic handler

c#,linq,linq-to-sql,handler
I have some query that is working correctly but I just copied exact code without any modification to a new Generic Handler (ashx) file and I'm getting an error. This is the code: System.Collections.Generic.List<ChartPrice> ChartPrices = new System.Collections.Generic.List<ChartPrice>(); using (DatabaseDataContext db = new DatabaseDataContext()) { ChartPrices = (from p1 in...

Android: UI freezes although use of Handler and postdelay

android,user-interface,handler
My app works with a few pictures. I want to take a new one every few seconds and add it to the pictures I work with. So I wrote this code, using an own Thread for the waiting time, so the ui won't freeze. Handler handler = new Handler(); int...

Handler postdelayed is not fired after given delay interval when quitting the app in android?

android,handler,runnable,postdelayed
Code Snippet: Handler handler= new Handler(); handler.postDelayed(networkRunnable, 10000); /** * A runnable will be called after the 10 second interval */ Runnable networkRunnable= new Runnable() { @Override public void run() { //Not fired if I quit the app before 10 seconds after 1 second. } }; Setting Handler post delayed...

StopService onDestroy being called but service not ending

android,service,timer,handler,timertask
I try using TimerTask to download data from the server api, the task loops in background app. I have a service class: public class RequestNewInvoice extends Service { private Timer timer; private CheckTask checkTask; private Handler handler; private JSONParser jsonParser; private JSONObject jsonObject; private boolean startService = true; private void...

toggling a group of icons in gWidgets

r,icons,handler,gwidgets
Adapting an example I can toggle the display of an icon like this: reject <- "D:/Pictures/web/close32.png" accept <- "D:/Pictures/web/open32.png" w= gwindow() g1 <- ggroup(horizontal=TRUE, cont=w) icon <- gimage(reject,cont=g1) state <- FALSE # a global changeState <- function(h,...) { if(state) { svalue(icon) <- reject } else { svalue(icon) <- accept }...

Javascript Event handler - why did this work?

javascript,events,handler
I am new to javascript, as you can tell from the code below. I wanted to create an event handler for 6 buttons that I have on a page. On clicking on a button, the display properties of the block of code below the button changes from "none" to "block"....

Event Handler Tabbed Web Browser With GeckoFX

vb.net,browser,tabs,handler,geckofx
I tried to make a tabbed web browser with geckofx. This is my code to make a new tab: Dim t As New TabPage Dim bro As New GeckoWebBrowser bro.Dock = DockStyle.Fill t.Text = "New Tab" t.Controls.Add(bro) TabMain.TabPages.Add(t) TabMain.SelectedTab = t bro.Navigate("http://www.google.com") Now, how to handle DocumentCompleted and DocumentTitleChanged in...

handler or alarm in android service?

android,handler,alarm,schedule
I have a service that run all time, and I need get Info from my server 2 times per day. must I use a Handler with 12Hs of delay? or an alarm? can you tell me what is the best option please? Thanks!...

This Handler class should be static or leaks may occur (null)

android,handler
This Handler class should be static or leaks may occur (null) Is the 'class' this message referring to 'MyActivity' here, since Handler is an object and i did declare it static. Should I ignore it or there something I should add, like 'static' somewhere in the 'MyActivity' declaration (I tried...

ASIO handler arguments and boost::bind, compile time error

boost,handler,boost-asio
I am struggling with compile time errors, and try as I might, I dont see in what way am I doing it wrong or different from handler function signature as set out in documentation/examples. (I am using Boost 1.41 on Linux) Please help me understand the error! (included below as...

Update UI from AsyncTask and handle properly screen rotate

android,multithreading,android-asynctask,handler
This code doesn't works when rotate screen. I try to use Handler but messages are dispached to previous Activity(before rotate) and to new Activity. ¿How can a thread send messages to new Activity? Please doesn't suggest avoid to rotate screen. public class SampleActivity extends Activity { TextView text; Handler handler;...

Windows Phone: how to handle an event from a web page in a WebView?

events,webview,event-handling,windows-phone,handler
Which callback/delegate is the one to intercept the event of a user clicking on a link within a WebView? I'd want that URL. I just need to know if it is possible and how should I do in some way.

How do I start the an activity when user doesn't use it anymore

android,timer,handler
I have two activities in my app, first activity leads to second and the second leads back to the first. In the second one he can record and message and leave his name. In case the user only uses the second activity and just walks away I want that it...

How to properly call handler method in C#?

c#,methods,parameters,handler
I am having issues with the following method below -GetTransactionsCompletedEventHandler. I am attempting to pass the necessary arguments to it, but it is also asking for more parameters in a format I am unfamiliar with. It is asking for GetTransactionsCompletedEventHandler(object[] results(object, GetTransactionsCompletedEventArgs)target) Can anyone point me in the right direction...

Speech Recognition Handler

android,handler,speech
This is my first time posting here. I'm new to Android Studio. I'd like to create a handler for google speech recognition. This is the main class package com.example.recnonocimientodevoz; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; public class Index extends Activity { private Button boton; private EditText...

“ReferenceError: handler is not defined” in Node.js

node.js,undefined,handler,referenceerror
This is the first line of my Node.js app: var app = require('http').createServer(handler); When I try to start it doing node index.js the result is: /home/username/public_html/index.js:1 var app = require('http').createServer(handler); ^ ReferenceError: handler is not defined My Node.js version is 0.12.4...

Delphi Stack Info during Event Handling

delphi,events,stack,handler
When debugging events I would like to see the "complete" stack, specifically the actual event or method that triggered an event. A simple example would be to drop a ComboBox on a form, and write an onChange event. The onChange event will trigger when a user changes the comboBox (obviously),...

Running toast in at certain interval in a service

java,android,multithreading,service,handler
I am trying to show a toast at 2 seconds interval from a service. This normal code works fine. This one is just a test to show toast. public int onStartCommand(Intent intent, int flags, int startId) { // Let it continue running until it is stopped. new Thread(new ToastRunner(this)).start(); return...

Thread and handler not work in android

android,multithreading,handler
I use loading before load completed listview This code worked : @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ListView listContent = (ListView) findViewById(R.id.listContent); adapter = new AdapterNote(G.tasks); listContent.setAdapter(adapter); Commands.readData(); adapter.notifyDataSetChanged(); } But after changing to the below code , application crashed and force closed : @Override public void...

Setting the background using a handler in android

android,handler
I want to change the background when you click a button, but only for a short period of time. I'm using a Handler button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Handler handler = new Handler(); Runnable r = new Runnable() { public void run() { relativeLayout = new RelativeLayout(MainActivity.this);...

How to register Shell Thumbnail handlers

c++,shell,handler,thumbnails
I am trying to define 2 custom filetypes that I want them to feature thumbnail previews within windows explorer and I used this code sample (https://code.msdn.microsoft.com/CppShellExtThumbnailHandler-32399b35) to register the new shell extension but I can only make one of them work at a time. The moment I try to register...

Java handler for JPA managed entities

java,hibernate,jpa,handler
As I'm new to the topic, the title of my question may be completely wrong- please correct me if needed. Now to the point: I have recently made a simple ORM project, that consists of 3 entity classes (Person, Account, PhoneNumber) with some relations. Right now, I just made a...

Python logging and Pydev debugger?

python,debugging,logging,configuration,handler
Edit : Using Liclipse 1.2.1 instead of 1.3.0 or 1.4.0 is working fine. Changelog indicate both Pydev 3.9.1 and Eclipse 4.4.1 updates for 1.3.0. Seems to break logging debug. Using Liclipse and Pydev debugger (and CPython) with the following code sample, getting that error : logging.config.dictConfig(config) File "C:\Python27\lib\logging\config.py", line 794,...

Swift - alert action handler error

ios,swift,handler,alert,flurry
I have some strange stuff going on: trying to track if a share action was cancelled in UIAlertAction handler with FLurry Analytics SDK. The code should basically look like that: let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: { (action:UIAlertAction!) -> Void in Flurry.logEvent("Share Cancelled") } ) But compiler shows...

Passing Activity Context to Handler(fragment) for Toast

android-fragments,handler,android-context,android-toast
I'm trying to use a Toast message in a handler fragment class but I can't access the main class' context. The handler is in the same class as the main activity, PlayFrets(which is also the UI thread).I've read through the plethora of questions on this topic on stackoverflow, but almost...

VB.NET: How to avoid/deny DataGridView SelectionChange event from being handled?

vb.net,events,datagridview,handler,selectionchanged
Here is my DataGridView: Me.DGV_InvoiceContainers.MultiSelect = False Me.DGV_InvoiceContainers.ReadOnly = True Me.DGV_InvoiceContainers.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect ... It contains one column and multiple rows. When clicking on a cell/row (different from the selected one), a logic test is done (under MouseDown Event handler) to be sure all conditions are fulfilled before changing selection....

removing object from game in Java (eclipse)

java,eclipse,class,object,handler
lets get right into it, i have a 'handler' class which is full of getters and setters and it includes in it code which adds and removes object, it looks like this: public void addObject(GameObject object){ this.object.add(object); } public void removeObject(GameObject object){ this.object.remove(object); Note that 'GameObject' is a class and...

Can a class call another function in a class without the firstclass needing to know the class that is it

java,class,networking,handler,packets
So I might have worded the question badly so I will try to explain what I mean. So i have a game server that interfaces with unity written in java and I was wandering if there was a better way of handling the received TCP stream data. Then someone suggested...

Netty IO check if Server closed

java,client,handler,netty,server
how can I check if the Server closed/shut down on the client-side? I want to notice the user when the Server closed. Is there any method to do that?

How to stop handler.postDelayed in for-loop?

java,android,for-loop,handler,runnable
I saw no real answer for this type of using "handler.posDelayed". So, I execute "handler.posDelayed" multiple times with a for-loop. The problem is, when I leave the activity and restart it, the new objects AND the old ones from the handler are executed too. I don't know, how to stop...

Android handler remove send message not working

android,handler
Android handler remove previous send message from the handler message queue. Remember I don't want to use removeCallbacks (Runnable r); Send broadcast intents - To send the message Intent i = new Intent(my_action); sendBroadcast(i); - To cancel any previous message Intent i = new Intent(my_action); i.putExtra("a","a"); sendBroadcast(i); public class TestBroadCast...

Is there a way to update certain objects 'live' on a webpage with Python 3?

python,http,handler
I'm busy with my own http handler and I have managed to make a neat website with my own-written database handler. However, is it someway possible to update a certain object live on a webpage? For example: <h1>Hello</h1> To: <h1>Bye</h1> LIVE? Because writing something to the webpage uses self.wfile.write('<h1>Hello</h1>') Is...

HandlerThread and Handler: how to use AudioRecord.setRecordPositionUpdateListener?

android,multithreading,handler,audiorecord,android-handlerthread
I'm confused by Handler and HandlerThread classes usage. The reason I'm trying to use them is I want to utilize AudioRecord class and its setRecordPositionUpdateListener method (reference). The methos description says: Use this method to receive AudioRecord events in the Handler associated with another thread than the one in which...

Using Handlers to loop through data

android,timer,handler
I'm trying to develop a method that will loop through a String variable and change the background color based on each character, with a one second delay so each individual color can be observed by the user. I've looked into similar problems, and most of the answers recommend Handlers() or...

NettyIO not correctly removing channels

java,error-handling,handler,netty,channel
I have a problem: Netty is not correctly removing the channel which disconnected in the handlerRemoved method. When I reconnect the client to the server, I get the following error: io.netty.channel.ChannelPipelineException: com.test.netty.NettyServerHandler is not a @Sharable handler, so can't be added or removed multiple times. at io.netty.channel.DefaultChannelPipeline.checkMultiplicity(DefaultChannelPipeline.java:464) at io.netty.channel.DefaultChannelPipeline.addLast0(DefaultChannelPipeline.java:136) at...

jqGrid onDelete event handler

events,jqgrid,delete,handler,extend
I'm using a jqGrid with datatype: 'local'. The data of the grid is being set dynamically via addRowData. I don't use the asynchronous ajax stuff such as url + datatype: json because the grid has to display only client state. Now I want to use the jqGrid delete row functionality...

how to open new activity from a thread with an handler

java,android,multithreading,handler
at the beginning every thing worked well, but i changed things and now the applcation crash when i open the new activity from a thread (not the UI thread). the application only crash on my phone after installation, in debug mode it work well for some reason i can't understand....

Repeated Background Query while app is running

android,mysql,service,handler
I find stackoverflow incredibly useful, but this time I cannot find an exact answer: I am afraid to pick up the wrong solution for my case. I am creating an app that manage restaurant reservations. When logged as a restaurant I'd like to have the possibility to call in the...

Sending a simple message from Service to Activity

java,android,service,handler
I am trying to find a way to send an integer value from my Service to my MainActivity, yet I can't figure it out with the tutorials on the internet. I am using a Handler to receive my messages which I'm sending from a Thread in my Service. My code...

Stack overflow on logging python module

python,logging,rotation,handler,stack-overflow
I'm having a problem with python 3, I'm trying to log the stdout and the stderr to a log file. I was able to figure it out using http://www.electricmonk.nl/log/2011/08/14/redirect-stdout-and-stderr-to-a-logger-in-python/ The point of it was to have both the log file and the console output as normal, while using only the...

correlation between inbount and outbound xml in soap handler

java,web-services,soap,jax-ws,handler
I am using org.apache.cxf:cxf-codegen-plugin to create web services from my wsdl files. For these services, i wrote a simple SOAPHandler< SOAPMessageContext > to log inbound and outbound xml. Here i can check that xml is outbound or inbound: (Boolean) messageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); But there is a problem about correlation between them. How...