179 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
41
views
Social-application: Broadcast auth take too long
I want to build a social application using Laravel 11, React and Reverb for websoket, I got this problem when connect to multiple channel for each conversation, each channel require auth, and it very ...
3
votes
1
answer
69
views
Android Handler: how to change delay of a scheduled Runnable?
The following code schedules a Runnable for immediate execution if this Runnable is already scheduled:
public void onSomeEvent() {
if (handler.hasCallbacks(runnable)) {
handler....
-1
votes
2
answers
101
views
How to loop (Rerun code every 60 seconds)
I have a specific code in my app that checks the connection etc. I want this code to be executed every 60 seconds(1 Minute). I don't quite understand the postDelayed() function. Can someone help me ...
0
votes
2
answers
1k
views
How to Mock Handler(Looper) on kotlin unit test
Handler(Looper.getMainLooper()).postDelayed(
{
println("inside the looper")
val firmwareVersion = managerService.getDeviceFirmwareVersion();
...
0
votes
1
answer
80
views
How to add random seconds delay in function (Android)?
I want to add random delay between 16 to 30 seconds in sending sms in sendSMS Function, I want to know on how to integrate delay for this function and where is the right position to add the seconds ...
0
votes
1
answer
49
views
disable button in listener for 1s and generate an output stream after that in android
I'm new in stackoverflow.
I created a simple bluetooth app to controll a relay board.
The Relay is "on" for 1s after clicking the a button.
It works so far but if I click the button during ...
0
votes
0
answers
72
views
Changing variable inside Runnable postDelayed method
Is it possible to make a runnable postDelayed method changes the value of its variable when running? Because it only loops the initial longitude and latitude that it gets even though the location is ...
0
votes
0
answers
651
views
Is using a variable as parameter(delaymillis) in Android postDelayed available?
I want to move to another Activity after 5 seconds.
(Step4Activity -> WeightActivity)
I found this code, and it worked.
new Handler().postDelayed(new Runnable()
{
@Override
...
1
vote
2
answers
813
views
How can I use Intent in postDelayed using Android?
This is for a splash screen. I've followed the tutorial but it's still not working. It keeps on getting an error.
This is my code:
package id.ac.umn.finalproject;
import androidx.appcompat.app....
0
votes
1
answer
52
views
PostDelayed() inside onFinish() in CountDownTimer
I need to use postDelayed() method inside onFinish() method of the CountDownTimer. I use the following code:
...
public void onFinish() {
Handler handler = new Handler();
handler.postDelayed(new ...
0
votes
4
answers
2k
views
How to disable button for 1 sec after clicked in Android?
I am using following code for using a button. I works.(sendBtn is a button in a fragment)
sendText = view.findViewById(R.id.send_text);
View sendBtn = view.findViewById(R.id.send_btn);
...
0
votes
0
answers
49
views
WebView doesn't show the PDF content sometimes using URL
I want to show PDF in a webView . I have a the URL of that PDF . It works at sometimes and shows the PDF but in sometimes doesn't show the PDF when I click on different URL in my RecyclerView .
I ...
0
votes
1
answer
151
views
Set Handler Postdelayed on Imageview dynamically
I am creating like a Whack a Molee type of game, and I am creating imageviews at random positions on the screen.
The thing is, I am adding a postdelayed to a var I am creating every two seconds ( the ...
0
votes
0
answers
486
views
How to execute some code from a function after that function has returned a value in Android?
I'm trying to execute some code defined in a function after that function has executed a return instruction.
I'm trying to do it this way:
Handler handler=new Handler();
handler.postDelayed(new ...
0
votes
1
answer
992
views
How to get heart rate every x seconds in Android Studio?
I want to get data from the Heart Rate sensor every x seconds.
I tried it with postDelayed() but that only works for reading the data every x seconds, but the sensor is running in that time and the ...