All Questions
812
questions
0
votes
2
answers
67
views
How can a Callable return a value from a predefined void callback?
I am using a data-related API interface which has a key void callback function that is automatically invoked to mark the end of some IO operations. I want to make the class Callable<String> and ...
-2
votes
0
answers
59
views
Can callback to an incompletely constructed Java object be well-defined?
If a constructor of a class T passes this to as an argument to some method foo, and foo immediately performs a callback to the T object (which has not yet finished executing its constructor), things ...
2
votes
1
answer
79
views
Java - Use null comparison or instanceof?
Below is a Java class constructor which accepts a callback for error handling. null should be an acceptable value, and if the passed value is null then skip error handling.
I have two ways of checking ...
0
votes
1
answer
37
views
linked hashmap get the first inserted
I have this LinkedHashMap which keep the order of the K-V pairs on the insertion order.
Map<Integer, String> map = new LinkedHashMap<>();
for (int i = 0; i < 1000000; i++) {
if (i =...
0
votes
0
answers
63
views
TelephonyCallback.CallStateListener with LiveData and ViewModel
I'm new to both android and java, now im trying to update a textview with the state of the call, but the view model doesn't get the value from the telephony callback class.
Im using post value since ...
0
votes
1
answer
23
views
How to get variable from GWT Callback
I'm trying to get a state of a server variable using a callback. Obviously, the state is always false. How can I get the state from the server? Or another question, which options do I have to get ...
0
votes
0
answers
105
views
How can I use APISetu to get documents from DigiLocker
I am trying to integrate DigiLocker APISs into my program. I am confused about lots of things, I need stepwise details to use DigiLocker to perform the following tasks:
First open DigiLocker page for ...
0
votes
1
answer
51
views
Java - receive a method that takes any number/type of parameters as method parameter
I'm implementing a Console Menu class in Java, roughly it looks like this:
public class ConsoleMenu {
private Scanner s = new Scanner(System.in);
private ArrayList<String> menuItems = ...
0
votes
1
answer
84
views
Calling functions from WebView to JS
In the java code(container) i have to get some values by calling some javascript functions, for this im using webView.evaluateJavascript, the problem is that i get the callback only when all the code ...
0
votes
1
answer
2k
views
onBackPressed is deprecated - webView in android app
I have an app where the main activity (which extends ComponentActivity) is pretty much just a webView. I have overriden onBackPressed, shown below.
@Override
public void onBackPressed(){
if(this....
1
vote
1
answer
96
views
Make a callback with JAVA RMI
I am currently implementing a kind of bag of tasks using Java RMI. The goal is for a "Client" to submit "Task" objects to a "Server," and on the other hand, I have "...
0
votes
1
answer
43
views
What thread should callbacks occur on in Java?
I'm developing a Java library that runs a scheduled task in a ScheduledExecutorService. If the user specifies callback(s), then after that task, those callback(s) will be invoked.
Right now I just ...
4
votes
0
answers
32
views
Register a callback to handle JLI_Launch failing with "Could not find or load main class"
I am trying to make AppBundler more observable and have had great success except for one thing. JLI_Launch does not return to the caller so I can't tell if it fails to load the main class (or any ...
0
votes
0
answers
46
views
Can we send back data from App to Chrome in previous opened Tab?
I have made a payment app in Java Kotlin. My requirement is that a webpage can call my app for payment then after successful payment I can response back that webpage with transaction ID.
From web page,...
0
votes
0
answers
19
views
The invalidate function[inside onChildAdded firebase's callback] doesn't invoke onDraw
Have a good day.
Actually, I have faced an issue, in which, the onDraw function is not being executed when onChildAdded is being invoking inside onChildAdded callback for firebase.
...