Questions tagged [android-thread]
147 questions
0
votes
0 answers
My Android application's thread doesn't work well when the application is in background
When I close my application, my thread is still working, but it randomly stops SensorListener and MusicPlayer after a few minutes. When I open my app, it works again.
How do I start my thread from MainActivity:
new…

Mateusz Szwedka
- 1
- 3
0
votes
1 answer
Trying to start already running service in background thread
I want to start a Service for a long running location fetching task.
I've chosen to use a foreground service for this task. I want this service to run in the background thread.
Now, after searching a bit, I have decided to start a new thread in…

Ananth
- 2,597
- 1
- 29
- 39
0
votes
3 answers
Android - how to overcome the 10 second limit when receiving broadcasts from IntentService?
I would like to know, I have an Activity that receives broadcasts from an IntentService that needs to save data and then export it to a CSV file. However, this can take longer than 10 seconds, and I know there are certain problems with starting…

Pink Jazz
- 784
- 4
- 13
- 34
0
votes
1 answer
How to obtain the expected order of actions in my game loop?
I don't fully understand what is going on behind the scene, and therefore, what I can do to correctly code this issue. I'm looking for an explanation that will lead me to figure it out myself. This is just a fun home based project(I'm not a…

Ryan G
- 380
- 1
- 11
0
votes
1 answer
Android runOnUiThread
I'm trying to get values through a query for the azure! After that I wanted to try to get these values and move to a new intent but I do not know how to do this because of threads
Here I start QrCode to find an id that I need
@Override
protected…

Pedro Gomes
- 11
- 4
0
votes
1 answer
ProgressBar in Android shows only after completing some operation
I tried to use ProgressBar in my Activity when I execute a short-time operation. And I realized that when I set ProgressBar visibility to true, It becomes visible only after the operation was…

Igor
- 105
- 8
0
votes
0 answers
How to make network call from recycler-view adaptor with ToggleButton
I have button in recycler view when I click it I want to change the text of button and make network call with volly.
I am getting this Exception
Java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
So,…

Makarand
- 983
- 9
- 27
0
votes
1 answer
Splash screen determining, which Activity to load on startup?
I am making a Splash screen, which determines which Activity to load, based on whether the App is being started for the first time (or not)..
The code is running in it's own Activity - MainActivity, which will act as the Splash screen. If it's the…

Studio2bDesigns
- 578
- 5
- 12
0
votes
2 answers
How to let a handler, which syncs with the main looper, wait for more data
When a new object from the Database arrives, a new Handler will be created which posts the object to the UI thread so that the UI processes and draws the object.
public void notify(MyObject myObject) {
Handler handler = new…

Homer
- 3
- 1
- 2
0
votes
2 answers
How to use timer in Android
In my application i have timer for some works.
When my application running after some time my application freeze and not work any View !
In this timer every 500ms i emit socket.io
My Codes:
AsyncTask.execute(new Runnable() {
@Override
…

Dr. Jake
- 249
- 2
- 3
- 9
0
votes
1 answer
Android - How to download a large nos of images (large nos of http url) in Background Process
I am getting a list of image url from server whose count is approximately in between 400-500. How can i download this image in background into local folder of the device ?
SO far i have run a foreground service in which i am using ExecutorService to…

Feroz Siddiqui
- 3,840
- 6
- 34
- 69
0
votes
1 answer
How to use Handle without increase Memory in Android
In my application I use ViewPager for show some data and I want set auto scroll between of pages in every 5sec.
I use below code for auto scroll between of pages in every 5sec.
private int page = 0;
private Handler handler;
private int delay =…

Dear User
- 93
- 8
0
votes
1 answer
Open dialog instantly and then load content for the dialog
Scenario: In my application, as I click on the button, it opens the dialog with WebView, loads some data (that involves copying, editing and loading the HTML file locally). The WebView is expected to display the HTML file created locally.
What is…

user846316
- 6,037
- 6
- 31
- 40
0
votes
1 answer
How add a function to run in a new thread
I have a function for check internet state:
public static boolean isOnline() {
Runtime runtime = Runtime.getRuntime();
try {
Process ipProcess = runtime.exec("/system/bin/ping -c 1 8.8.8.8");
int exitValue =…
0
votes
1 answer
Using camera with thread
I am trying get the image of the camera and process it continuous, so, I am using CameraKit package:
package com.example.alex.tfmobile;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import…

Alex
- 3,301
- 4
- 29
- 43