Skip to main content

All Questions

Tagged with
0 votes
1 answer
676 views

How to execute callback of async call on Java's main thread?

Is there a way to force the execution of the callback to be executed on the main thread? For example, in the following code: public static void main(String[] args) throws Exception { ...
Barak Sason Rofman's user avatar
-1 votes
1 answer
101 views

Object callback defined in unusual way in Java

I came across a code, and 1 thing stumped me. Here is the code static public Return fun1() { return new register(new SomeMap[]{ null, new SomeMap(new Basic(String.class), new ...
Yogi's user avatar
  • 1,047
0 votes
1 answer
71 views

Is is possible to specify a JNA callback programmatically?

I know how to specify a JNA callback (C to Java) the regular way, like for example: C header: static void (*InvokerInst)(int, int); __declspec(dllexport) int start(); __declspec(dllexport) void ...
Hervé Girod's user avatar
0 votes
1 answer
1k views

Callback function as an argument in Java

I am new to Java programming and have got a question. I saw in JavaScript that you can give a function as an argument to a function. How does this work with Java? I want to accomplish the following: ...
itsaunix's user avatar
2 votes
1 answer
562 views

How can I use the Retrofit response outside the OnResponse function so I can return it up the recommended architecture model?

This question follows on from How can I use the Retrofit response outside the OnResponse function?, but I'm not allowed to comment, so I'm asking it for myself here. I'm trying to use the Android ...
maganthro's user avatar
  • 439
0 votes
0 answers
918 views

"CallObjectMethod" in JNI-Callback returns NULL

I have a JNI-Interface between C++ and Java. I want to pass a callback function as a parameter in a function on java side. This will be called later in C ++ via JNI and should return me a string. This ...
TheValbo's user avatar
0 votes
3 answers
133 views

Callback codes execution

I am trying to understand callbacks in Java, but it's confusing me a lot. I know callbacks are passed as an object by implementing interface. But I'm not able to understand how the functions of those ...
Ash3060's user avatar
  • 340
1 vote
1 answer
86 views

TextView setText() called in callbacks from wrong context [duplicate]

I tried implementing a network service discovery and setting the name into a textView after successful registration. But I am getting an android.view.ViewRootImpl$CalledFromWrongThreadException: Only ...
Torben E's user avatar
  • 341
0 votes
1 answer
729 views

The points doesn'tupdated when a user completed an offer in AyeTStudios Offerwall

recently i implemented the AyeT Offerwall to my android app, all worked fine but when an user complete an offer doesn't update the coins. It says you can manage users balance with a callback URL but i ...
Jelosus1's user avatar
4 votes
0 answers
183 views

Why does Java expose Error and Java SE API callback methods accept Throwable instead of Exception?

Facts The Java SE API says about the Error type that it "indicates serious problems that a reasonable application should not try to catch"; also "errors are abnormal conditions that ...
Valentin Kovalenko's user avatar
0 votes
0 answers
42 views

ArrayList been overridden when calling a method inside a for loop and method does firebase calls

This method getBedHistory takes an input as list of beds called allBedsWithoutStatus() and a date. I have 34 beds in my allBedsWithoutStatus(). It calls a method called calculateStatus() and then ...
androidbeginnercoder's user avatar
0 votes
3 answers
832 views

JavaFX: I need to set a value from an Event Handler to a variable

I need a way to get the value from a textfield to a variable when a button is clicked. I understand I may need to use a callback but I have never used one and I am not sure how to implement one in ...
Rhett Harrison's user avatar
0 votes
1 answer
233 views

How can i make my method return a callback?

Im trying to code for an trading bot using the java binance api. what i`d like to do is use to async client from the library to create a method to fetch data/candlesticks and then return it. My ...
bakbeest's user avatar
3 votes
1 answer
4k views

kafka multi-threaded consumer with manual commit offset: KafkaConsumer is not safe for multi-threaded access

I use ArrayBlockingQueue to decouple Kafka consumers from sinks: Multi-threaded consumption of Kafka, one kafka consumer per thread; Kafka consumer manually manages the offset; The Kafka consumer ...
yewei.oyyw's user avatar
0 votes
1 answer
337 views

Jersey InvocationCallback Completed: Which thread is used to invoke these methods

I am working on a Async Processing Module and Implemented Jersey Invocation Callback. My implementation is straight forward and am defining a Completed and Failed methods as mentioned in https://docs....
varkashy's user avatar
  • 385

15 30 50 per page
1
3 4
5
6 7
55