0

When I try to call runQuery(CharSequence constraint) method, I get the following errors and my application crashes.

In that method, I am passing a MatrixCursor, which is created from data retrived from server.

12-31 15:20:45.269: D/Dialapp(3896): ActivitySIPCallScreen:parseIntent
12-31 15:20:48.479: E/RESPONSE:(3896): IP:192.168.1.121 URL: http://192.168.1.121/FMC_api/
12-31 15:20:51.519: D/dalvikvm(3896): GC_CONCURRENT freed 1406K, 14% free 12741K/14723K, paused 3ms+3ms
12-31 15:21:00.199: E/ActivityThread(3896): Activity com.godialect.dialapp.ui.ActivitySIPCallScreen has leaked ServiceConnection com.godialect.dialapp.ui.ActivitySIPCallScreen$1@4140ffd8 that was originally bound here
12-31 15:21:00.199: E/ActivityThread(3896): android.app.ServiceConnectionLeaked: Activity com.godialect.dialapp.ui.ActivitySIPCallScreen has leaked ServiceConnection com.godialect.dialapp.ui.ActivitySIPCallScreen$1@4140ffd8 that was originally bound here
12-31 15:21:00.199: E/ActivityThread(3896):     at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:936)
12-31 15:21:00.199: E/ActivityThread(3896):     at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:830)
12-31 15:21:00.199: E/ActivityThread(3896):     at android.app.ContextImpl.bindService(ContextImpl.java:1129)
12-31 15:21:00.199: E/ActivityThread(3896):     at android.content.ContextWrapper.bindService(ContextWrapper.java:370)
12-31 15:21:00.199: E/ActivityThread(3896):     at com.godialect.dialapp.ui.ActivitySIPCallScreen$2.run(ActivitySIPCallScreen.java:331)

Code snippet:

public Cursor runQuery(CharSequence constraint) {

    stopManagingCursor(mContactsCursor);        

        contacts.moveToFirst();     
        //ProgressDialog dialog = ProgressDialog.show(ActivityDialerScreen.this, "Loading,", " ==" +  contacts.getString(0), true);
        return contacts;
}

and

    mAsyncContactImageLoader = new AsyncContactImageLoader( getApplicationContext(), getResources().getDrawable(R.drawable.contactlist_default_image));
    mCallLogAdapter = new Adapter_CallLogs(getApplicationContext(), null, mAsyncContactImageLoader);
    mContactsAdapter = new Adapter_Contacts(getApplicationContext(), mContactsCursor, mAsyncContactImageLoader);
    mContactsAdapter.setFilterQueryProvider(this);
    mContainerDialerScreen.contactList.setAdapter(mContactsAdapter);

Adapter_Contacts is at here

GroupingCursorAdapter is at here

Uniruddh
  • 4,427
  • 3
  • 52
  • 86

1 Answers1

1

This error says that ActivitySIPCallScreen has been finished and after that you have been trying to start ServiceConnection from it's context.

Also read this answer about leaking activities.

Community
  • 1
  • 1
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
  • here what did you mean by `ActivitySIPCallScreen` been finished ? Is it like,its `onDestroy()` method have been called ? – Uniruddh Dec 31 '13 at 10:19
  • @I-droid Yeah. In most cases it invoked by finish() call, but there are other scenarios as well. – Ilya Gazman Dec 31 '13 at 10:21