Questions tagged [bindservice]
40 questions
9
votes
1 answer
Binding PlayerView with SimpleExoPlayer from a service
I have implemented a Service to run the audio in background which runs perfectly but I am unable to get the instance of the SimpleExoPlayer from the service to the activity to update the UI and also the Audio plays twice in the background if I exit…
![](../../users/profiles/9419047.webp)
Akram Hussain
- 331
- 5
- 18
7
votes
0 answers
Android Architecture Components: ViewModel/Repository vs bind to Service/IntentService
I want to implement/refactor an app to the Android Architecture Components concept, see https://developer.android.com/jetpack/docs/guide
In this topic Android Architecture Components ViewModel - communication with Service/IntentService, I found a…
![](../../users/profiles/6251815.webp)
rico_s
- 191
- 1
- 6
5
votes
1 answer
What happen when the activity crash?
I have a service created like this :
Then I implement the onBind…
user7898586
4
votes
2 answers
What is bindServiceAsUser() method in Android?
I cannot understand what is the bindServiceAsUser() method used for. Can anyone please kindly explain about it ? Googling seems doesn't help much.
public boolean bindService(Intent intent, ServiceConnection connection, int flags) {
return…
![](../../users/profiles/1583951.webp)
zoro
- 303
- 3
- 11
3
votes
0 answers
Start Activity from Bound Service to get DrawOverlays permission but keep the service running
I need to get DrawOverlays permission from my bound service. I am starting the activity - Settings.ACTION_MANAGE_OVERLAY_PERMISSION provided by Android, to open the settings activity for the user, to give permission.
The problem is as soon as the…
![](../../users/profiles/4516974.webp)
AKSHIT
- 58
- 7
2
votes
3 answers
Pivotal Cloud Foundry - Why is restart required after bind-service
The entry in VCAP_SERVICES seems to be getting added as soon as as cf bind-service command is called. If that is the case why is Restart required
![](../../users/profiles/2673088.webp)
Chandralekha R Menon
- 21
- 2
2
votes
3 answers
SpeechRecognizer, bind to recognition service failed
I used SpeechRecognizer on android to recognize the User's voice.
It worked well until uninstall the Google App.
(https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en)
I updated the Google App, but I got…
![](../../users/profiles/8292965.webp)
hobbydev
- 638
- 9
- 21
1
vote
0 answers
Can't bind service to fragment
I have an app which plays music. When the app starts loading, music starts playing. The choice of the song is random. In the fragment shows song's name. Music is playing, but song name cannot be displayed. What am I doing wrong? (It is not…
![](../../users/profiles/13978879.webp)
Julia
- 329
- 7
1
vote
0 answers
How to call method immediately after i bound my service from fragment?
Code in fragment
In my fragment i check if my service was bound already or not, but how can i immediately call my second method when Main.bindMusicService(); is finished (after onServiceConnected gets called)?
Now i have to tap my song 2 times…
![](../../users/profiles/9017620.webp)
Vince VD
- 1,286
- 10
- 30
1
vote
0 answers
Does bindService also call the onCreate method?
Can i call bindService without calling startService? If so, does it also call my onCreate method in my Service?
public static void bindMusicService(Context c){
/*mediaPlayerServiceIntent binds our connection to the MediaPlayerService. */
…
![](../../users/profiles/9017620.webp)
Vince VD
- 1,286
- 10
- 30
1
vote
1 answer
bindservice wont start the service and onserviceconnect wont call
I`m trying to build and run a service for react native app, and after the service is running i need to call to some of the service methods what means that i need to get an instance of the running service so im trying to use bindservice().
the…
![](../../users/profiles/7974360.webp)
Daniel231
- 13
- 3
1
vote
1 answer
Android service still resides in RAM after onDestroy() is called
I'd like to perform the memory test of my android package.
In my package, there is only one very simple service.
The service is started only by bindService from another package. (not startService)
After, another package (package 1) calls bindService…
![](../../users/profiles/9595216.webp)
Logan
- 21
- 3
1
vote
1 answer
sending string to service app from another app
I want to send a string from an app to a service, I used bind service and I have implemented this code:
package pref.com.app1;
public class MainActivity extends AppCompatActivity {
Messenger mService = null;
/** Flag indicating whether we…
![](../../users/profiles/6186321.webp)
Bahar Azartoos
- 59
- 1
- 9
1
vote
0 answers
Service bindService vs LocalBroadcastManager
I have multiple activities and a background always running service (see context here).
Which approach is better, use bindService() or app confined notifications using sendBroadcast() and a BroadcastReceiver in each activity?
Thanks
![](../../users/profiles/4317945.webp)
Gabe
- 5,279
- 4
- 30
- 78
1
vote
1 answer
Android Service donot get Bound
Hi I am new to android and exploring the services part.I could not bind the service using bind method.I could not figure out whether it is problem with bind method or on service connected.Someone please help me with it.Thanks in advance
Activity…
![](../../users/profiles/4500308.webp)
Pavan Kumar
- 77
- 1
- 6