Questions tagged [android-thread]
147 questions
0
votes
2 answers
How to make AlertDialogs appear and dissappear successively?
I want AlertDialog with message "1" to appear on screen and after 3 seconds to dissappear then I want another AlertDialog with message "2" to appear on screen and after 3 seconds to dissappear and so on and so forth until 5. I have the following…

Profile3ForStack
- 81
- 1
- 13
0
votes
2 answers
Android Volley and the usage of Tasks or Threads in the response
in my App i do different requests to get the HTML code of a website. After that, the App parses the HTML, maybe another request will performed and parsed. At the end a ListView is filled with the parsed data.
Now i read that Volley runs all code in…

Neo1989
- 21
- 3
0
votes
0 answers
Execute Webview in background without UI
In my app a use a WebView that displays a login screen. Once the user is logged in and the token expires, I reuse the Webview with the cached credentials in order to relogin. The thing is that I want to do this relogin action in the background,…

Fivos
- 558
- 8
- 19
0
votes
2 answers
Stop current thread if mutual exclusion detected
In my android Application I've got a specific method in one of my MODEL classes and this method always gets called from a separate thread other than UI thread.
The AlarmManger periodically runs this method and also user have the option to run this…

JibW
- 4,538
- 17
- 66
- 101
0
votes
1 answer
Button doesn't work on a new thread
Previously I had error - something about some loop, I've seen info that it is necessary in that case to start a new thread for button, but still nothing happens, thought logs show no errors now.
import android.content.Context;
import…

Andy D
- 125
- 13
0
votes
1 answer
countinue a method after Executors.newFixedThreadPool finish's its job
I have a method. inside this method I run a task by Executors. its work is fetch data from server and fill an results Arraylist.
public Paginator(String secSrv, int total, ExecutorService executorService, Cookie cookie) {
securitySrv =…

Groot
- 177
- 1
- 2
- 10
0
votes
1 answer
Android - Send data from MainActivity to Thread
in my Android app I need to send any changes from my UI to a thread.
User changes a textview and I need to get value and sent to thread processing. Is it possible ?
I have see only solutions from thread to UI (via runOnUiThread), but not UI to…

enfix
- 6,680
- 12
- 55
- 80
0
votes
0 answers
How to count the effective time of smartphone usage (without locks time)
I need to count the phone real usage Time i.e. when the user press a button I need to start something for counting the time that the screen is on but when the user locks the phone the counter must be stopped and It must be restarted when the user…

Fobi
- 435
- 1
- 7
- 17
0
votes
1 answer
UI Freezes Running multiple Threads in IntentService
So in my android application, I have an intent service which pings devices and finds whether they are online/offline.
When I start my IntentService my UI freezes(Debug points to when ping commands are being executed) in the Service.
Service is…

usr30911
- 2,731
- 7
- 26
- 56
0
votes
0 answers
Under android, Can i do Settings.Secure.getInt() from a background thread?
under android, can i run the code below :
int locationMode = Settings.Secure.getInt(this.getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_HIGH_ACCURACY);
from a background thread (not from the main ui thread) ?
user8371791
0
votes
1 answer
Destroyed fragment content remains on screen
I have fragments making API call via Retrofit + RxJava. I subscribe the Subscription in onActivityCreated and dispose at onDestroy. When I switch from FragmentA to FragmentB while FragmentA is still processing the API call, FragmentB appears below…

Eric V. Swann
- 3
- 3
0
votes
0 answers
Frame Animation not working when using AsyncTask.execute() before or after it
Why is AsyncTask here causing obstruction in code which is not related to it. For example:
Animation runs in this code:
if(!(speakMe.getStatus() == AsyncTask.Status.RUNNING) ){
((AnimationDrawable) mImageView.getBackground()).start();
…
user5508088
0
votes
1 answer
What type of threading for this kind of activity?
I have an activity that gets started by a background service in order to show scrolling message(s) that the service receives from a server. It's possible to have just one scrolling message or a set of multiple to scroll, one at a time.
My question…

csr19us
- 105
- 9
0
votes
1 answer
Android development with running a tone on MainActivity
i am writing code to play a small size tone on starting of my app.
can you please explain the meaning of the code which i have written down here?
Log.i("MY IIIT APP","MY SPLASH STATED");
mp=MediaPlayer.create(this,…

user8006058
- 27
- 2
0
votes
0 answers
getName() on new thread returns 'main'
I initialize and run a new thread in onCreate() in MainActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
// ... code
// New thread
new Thread(){
@Override
public void run(){
// Output is 'TAG:…

the_prole
- 8,275
- 16
- 78
- 163