serviceconnection

Android: onServiceConnected not called after bindService

纵然是瞬间 提交于 2020-01-30 03:28:40
问题 None of the many similar questions I have found have helped to solve my issue. Here are some questions I've looked at: ServiceConnection.onServiceConnected() never called after binding to started service onServiceConnected never called after bindService method ServiceConnection::onServiceConnected not called even though Context::bindService returns true? OnServiceConnected not getting called Here is part of my android app code: //Local service interface private INetworkQueryService

Android: onServiceConnected not called after bindService

我怕爱的太早我们不能终老 提交于 2020-01-30 03:28:05
问题 None of the many similar questions I have found have helped to solve my issue. Here are some questions I've looked at: ServiceConnection.onServiceConnected() never called after binding to started service onServiceConnected never called after bindService method ServiceConnection::onServiceConnected not called even though Context::bindService returns true? OnServiceConnected not getting called Here is part of my android app code: //Local service interface private INetworkQueryService

Starting a Service in an AlertDialog and have an outside Activity bound to it

孤人 提交于 2019-12-12 05:49:11
问题 First of all I've tried searching for this ans was unsuccessful. If my question is out there already answered could someone please point me to it? Thank you very much for either helping me here by looking at this, or even by skimming this and pointing me in the right direction. I really do appreciate it! My dilemma: I have an activity, and in that activity there is listview. The listview has multiple items inside it that most need to call an AlertDialog. The AlertDialog calls a service that

ServiceConnection leak when not using BIND_AUTO_CREATE

不羁的心 提交于 2019-12-11 04:40:06
问题 Could you please explain to me, what happens when we bind to service, but never start it and then unbind? I'm getting "Activity has leaked a Service Connection error", but I do not understand why. MyService: package com.example.servicetest; import android.app.Service; import android.content.Intent; import android.os.Binder; import android.os.IBinder; public class MyService extends Service{ Binder mLocalBinder = new Binder(); @Override public IBinder onBind(Intent intent) { return mLocalBinder

Is there a need to have one ServiceConnection per each Service bind?

拟墨画扇 提交于 2019-12-10 15:38:58
问题 I have several Android Service s that I want to bind to in my Activity , so I can monitor several actions from the user. To be able to bind every Service, and I will have several, do I need several private ServiceConnection s in my activity like the following? /** Defines callbacks for service binding, passed to bindService() */ private ServiceConnection mConnection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName className, IBinder service) { // We've bound

Activity has leaked ServiceConnection com.google.android.youtube.player that was originally bound here

喜你入骨 提交于 2019-12-04 05:27:47
问题 I'm using an Activity that has a layout with android.support.v4.view.ViewPager that I used to manipulate Tab navigation. I have different Fragments for different Tabs. On my third Tab, I'm loading some YouTube thumbnails from my YouTube account. When I load the application (when I'm staying at the first Tab) and press Back to exit from the application, it exists without any issue. But when I navigate to second Tab and try to press Back button, app exists with an error as follow. E

LicenseChecker checkAccess leaks ServiceConnection

纵饮孤独 提交于 2019-12-03 23:25:14
问题 I am receiving this exception in LogCat every time I press the Back button in my app: Activity has leaked ServiceConnection com.android.vending.licensing.LicenseChecker@471cc039 that was originally bound here The code responsible for this leak in onCreate() is: mLicenseCheckerCallback = new MyLicenseCheckerCallback(); mChecker.checkAccess(mLicenseCheckerCallback); How do I get rid of this leak? I tried not assigning MyLicenseCheckerCallback to a member, thinking perhaps when the activity goes

java.lang.NullPointerException showing at mBoundService.setAlarm(c);

孤街浪徒 提交于 2019-12-02 11:54:16
问题 I want to remind the user when he selected some date. I found an example for a remainder here but I got a NullPointerException . package com.example.eventremainder; import java.util.Calendar; import com.example.eventremainder.R; import com.example.eventremainder.Service.ScheduleClient; import android.app.Activity; import android.app.AlertDialog; import android.content.ContentValues; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import

java.lang.NullPointerException showing at mBoundService.setAlarm(c);

孤街醉人 提交于 2019-12-02 03:56:11
I want to remind the user when he selected some date. I found an example for a remainder here but I got a NullPointerException . package com.example.eventremainder; import java.util.Calendar; import com.example.eventremainder.R; import com.example.eventremainder.Service.ScheduleClient; import android.app.Activity; import android.app.AlertDialog; import android.content.ContentValues; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.provider.Contacts;

MainActivity has leaked ServiceConnection android.speech.SpeechRecognizer$Connection@414ee400 that was originally bound here

☆樱花仙子☆ 提交于 2019-12-01 15:50:00
In my app I recognize the user saying "exit" or "close" and the app should close. With this code SpeechRecognizer sr; Map<String, Integer> dictionary; private static final int EXIT = 1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); populateDictionary(); SpeechRecognizer sr = SpeechRecognizer.createSpeechRecognizer(this); sr.setRecognitionListener(this); Intent voiceIntent = RecognizerIntent.getVoiceDetailsIntent(getApplicationContext()); sr.startListening(voiceIntent); } @Override public boolean