Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9247323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:41:57+00:00 2026-06-18T09:41:57+00:00

I really need some help with a leak I get while switching from one

  • 0

I really need some help with a leak I get while switching from one to another activity. I am trying to use the YouTube Android API, I load a playlist into some clickable thumbnails and them to play a video. Everything seemed to work, but then I noticed a leak in Logcat.

Here is my code:

public class MainActivity extends Activity implements
    OnInitializedListener,
    YouTubeThumbnailLoader.OnThumbnailLoadedListener, OnClickListener {

YouTubeThumbnailView thumbs1, thumbs2, thumbs3, thumbs4, thumbs5

YouTubeThumbnailLoader Loader;

ImageView play1, play2, play3, play4, play5;

RelativeLayout tempLayout;

public static final String DEVELOPER_KEY = "xxxxxxxxxxxxxxxxxxxxxxxx";

String videolist, taal;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
     requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_main);
    tempLayout = (RelativeLayout) findViewById(R.id.tempLayout);
    tempLayout.setVisibility(View.VISIBLE);

    taal = Locale.getDefault().getLanguage();
    if(taal.equals("nl")){
    videolist = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    }else{
    videolist = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";   
    }

    play1 = (ImageView) findViewById(R.id.play1);
    play2 = (ImageView) findViewById(R.id.play2);
    play3 = (ImageView) findViewById(R.id.play3);
    play4 = (ImageView) findViewById(R.id.play4);
    play5 = (ImageView) findViewById(R.id.play5);


    play1.setVisibility(View.INVISIBLE);
    play2.setVisibility(View.INVISIBLE);
    play3.setVisibility(View.INVISIBLE);
    play4.setVisibility(View.INVISIBLE);
    play5.setVisibility(View.INVISIBLE);

    thumbs1 = (YouTubeThumbnailView) findViewById(R.id.thumbs1);
    thumbs2 = (YouTubeThumbnailView) findViewById(R.id.thumbs2);
    thumbs3 = (YouTubeThumbnailView) findViewById(R.id.thumbs3);
    thumbs4 = (YouTubeThumbnailView) findViewById(R.id.thumbs4);
    thumbs5 = (YouTubeThumbnailView) findViewById(R.id.thumbs5);

    thumbs1.initialize(DEVELOPER_KEY, this);
    thumbs2.initialize(DEVELOPER_KEY, this);
    thumbs3.initialize(DEVELOPER_KEY, this);
    thumbs4.initialize(DEVELOPER_KEY, this);
    thumbs5.initialize(DEVELOPER_KEY, this);


}

@Override
public void onInitializationFailure(YouTubeThumbnailView v,
        YouTubeInitializationResult arg1) {
    // TODO Auto-generated method stub
    tempLayout.setVisibility(View.INVISIBLE);
    Toast.makeText( this,"Unable to initialize",Toast.LENGTH_LONG).show();


}

@Override
public void onInitializationSuccess(YouTubeThumbnailView v,
        YouTubeThumbnailLoader loader) {
    // TODO Auto-generated method stub
    this.Loader = loader;
    Loader.setOnThumbnailLoadedListener(this);
    if (v == thumbs1)
        Loader.setPlaylist(videolist, 0);
    if (v == thumbs2)
        Loader.setPlaylist(videolist, 1);
    if (v == thumbs3)
        Loader.setPlaylist(videolist, 2);
    if (v == thumbs4)
        Loader.setPlaylist(videolist, 3);
    if (v == thumbs5)
        Loader.setPlaylist(videolist, 4);

}

@Override
public void onThumbnailError(YouTubeThumbnailView v, ErrorReason arg1) {
    // TODO Auto-generated method stub
    if (isOnline() == true) {

        tempLayout.setVisibility(View.INVISIBLE);

        if (v == thumbs1)
            play1.setImageResource(R.drawable.unav);
        play1.setVisibility(View.VISIBLE);
        if (v == thumbs2)
            play2.setImageResource(R.drawable.unav);
        play2.setVisibility(View.VISIBLE);
        if (v == thumbs3)
            play3.setImageResource(R.drawable.unav);
        play3.setVisibility(View.VISIBLE);
        if (v == thumbs4)
            play4.setImageResource(R.drawable.unav);
        play4.setVisibility(View.VISIBLE);
        if (v == thumbs5)
            play5.setImageResource(R.drawable.unav);
        play5.setVisibility(View.VISIBLE);

    } else {
        tempLayout.setVisibility(View.INVISIBLE);
        Toast.makeText(this,
                "Error: "+ arg1",
                Toast.LENGTH_LONG).show();

    }
}

@Override
public void onThumbnailLoaded(YouTubeThumbnailView v, String arg1) {
    // TODO Auto-generated method stub
    tempLayout.setVisibility(View.INVISIBLE);

    play1.setVisibility(View.VISIBLE);
    play2.setVisibility(View.VISIBLE);
    play3.setVisibility(View.VISIBLE);
    play4.setVisibility(View.VISIBLE);
    play5.setVisibility(View.VISIBLE);
    v.setTag(arg1);
    v.setOnClickListener(this);
}

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub

    String vid = v.getTag().toString();
    if(Loader != null){
    Loader.release();
    Loader = null;
}
    Intent intent = new Intent(MainActivity.this, PlayerActivity.class);
    intent.putExtra("play", vid);
    startActivity(intent);
    finish();
}

public boolean isOnline() {
    ConnectivityManager CM = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo nwi = CM.getActiveNetworkInfo();
    if (netInfo != null && nwi.isConnected()) {
        return true;
    }
    return false;
}

} 

Now this is my LogCat output when I the activity is finished by clicking the thumbnail, so the code in the onClick method:

01-30 19:29:04.122: E/ActivityThread(21292): Activity com.reemdroid.tube.MainActivity      has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f42c50 that was originally bound here
01-30 19:29:04.122: E/ActivityThread(21292): android.app.ServiceConnectionLeaked:   Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f42c50 that was originally bound here
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1418)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1407)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
01-30 19:29:04.122: E/ActivityThread(21292):    at com.google.android.youtube.player.internal.r.e(Unknown Source)
01-30 19:29:04.122: E/ActivityThread(21292):    at com.google.android.youtube.player.YouTubeThumbnailView.initialize(Unknown Source)
01-30 19:29:04.122: E/ActivityThread(21292):    at com.reemdroid.tube.MainActivity.onCreate(MainActivity.java:140)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.Activity.performCreate(Activity.java:5104)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.os.Looper.loop(Looper.java:137)
01-30 19:29:04.122: E/ActivityThread(21292):    at android.app.ActivityThread.main(ActivityThread.java:5039)
01-30 19:29:04.122: E/ActivityThread(21292):    at java.lang.reflect.Method.invokeNative(Native Method)
01-30 19:29:04.122: E/ActivityThread(21292):    at java.lang.reflect.Method.invoke(Method.java:511)
01-30 19:29:04.122: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-30 19:29:04.122: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-30 19:29:04.122: E/ActivityThread(21292):    at dalvik.system.NativeStart.main(Native Method)
01-30 19:29:04.132: E/ActivityThread(21292): Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f23660 that was originally bound here
01-30 19:29:04.132: E/ActivityThread(21292): android.app.ServiceConnectionLeaked: Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f23660 that was originally bound here
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1418)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1407)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
01-30 19:29:04.132: E/ActivityThread(21292):    at com.google.android.youtube.player.internal.r.e(Unknown Source)
01-30 19:29:04.132: E/ActivityThread(21292):    at com.google.android.youtube.player.YouTubeThumbnailView.initialize(Unknown Source)
01-30 19:29:04.132: E/ActivityThread(21292):    at com.reemdroid.tube.MainActivity.onCreate(MainActivity.java:129)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.Activity.performCreate(Activity.java:5104)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.os.Looper.loop(Looper.java:137)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ActivityThread.main(ActivityThread.java:5039)
01-30 19:29:04.132: E/ActivityThread(21292):    at java.lang.reflect.Method.invokeNative(Native Method)
01-30 19:29:04.132: E/ActivityThread(21292):    at java.lang.reflect.Method.invoke(Method.java:511)
01-30 19:29:04.132: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-30 19:29:04.132: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-30 19:29:04.132: E/ActivityThread(21292):    at dalvik.system.NativeStart.main(Native Method)
01-30 19:29:04.132: E/ActivityThread(21292): Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f3d140 that was originally bound here
01-30 19:29:04.132: E/ActivityThread(21292): android.app.ServiceConnectionLeaked: Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f3d140 that was originally bound here
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1418)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1407)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
01-30 19:29:04.132: E/ActivityThread(21292):    at com.google.android.youtube.player.internal.r.e(Unknown Source) 
01-30 19:29:04.132: E/ActivityThread(21292):    at com.google.android.youtube.player.YouTubeThumbnailView.initialize(Unknown Source)
01-30 19:29:04.132: E/ActivityThread(21292):    at com.reemdroid.tube.MainActivity.onCreate(MainActivity.java:138)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.Activity.performCreate(Activity.java:5104)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.os.Looper.loop(Looper.java:137)
01-30 19:29:04.132: E/ActivityThread(21292):    at android.app.ActivityThread.main(ActivityThread.java:5039)
01-30 19:29:04.132: E/ActivityThread(21292):    at java.lang.reflect.Method.invokeNative(Native Method)
01-30 19:29:04.132: E/ActivityThread(21292):    at   java.lang.reflect.Method.invoke(Method.java:511)
01-30 19:29:04.132: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-30 19:29:04.132: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-30 19:29:04.132: E/ActivityThread(21292):    at dalvik.system.NativeStart.main(Native Method)
01-30 19:29:04.142: E/ActivityThread(21292): Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f291f8 that was originally bound here
01-30 19:29:04.142: E/ActivityThread(21292): android.app.ServiceConnectionLeaked: Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f291f8 that was originally bound here
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1418)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1407)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
01-30 19:29:04.142: E/ActivityThread(21292):    at com.google.android.youtube.player.internal.r.e(Unknown Source)
01-30 19:29:04.142: E/ActivityThread(21292):    at com.google.android.youtube.player.YouTubeThumbnailView.initialize(Unknown Source)
01-30 19:29:04.142: E/ActivityThread(21292):    at com.reemdroid.tube.MainActivity.onCreate(MainActivity.java:131)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.Activity.performCreate(Activity.java:5104)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.os.Looper.loop(Looper.java:137)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ActivityThread.main(ActivityThread.java:5039)
01-30 19:29:04.142: E/ActivityThread(21292):    at java.lang.reflect.Method.invokeNative(Native Method)
01-30 19:29:04.142: E/ActivityThread(21292):    at java.lang.reflect.Method.invoke(Method.java:511)
01-30 19:29:04.142: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-30 19:29:04.142: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-30 19:29:04.142: E/ActivityThread(21292):    at dalvik.system.NativeStart.main(Native Method)
01-30 19:29:04.142: E/ActivityThread(21292): Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f2ed08 that was originally bound here
01-30 19:29:04.142: E/ActivityThread(21292): android.app.ServiceConnectionLeaked: Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f2ed08 that was originally bound here
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1418)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1407)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
01-30 19:29:04.142: E/ActivityThread(21292):    at     com.google.android.youtube.player.internal.r.e(Unknown Source)
01-30 19:29:04.142: E/ActivityThread(21292):    at com.google.android.youtube.player.YouTubeThumbnailView.initialize(Unknown Source)
01-30 19:29:04.142: E/ActivityThread(21292):    at com.reemdroid.tube.MainActivity.onCreate(MainActivity.java:133)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.Activity.performCreate(Activity.java:5104)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.os.Looper.loop(Looper.java:137)
01-30 19:29:04.142: E/ActivityThread(21292):    at android.app.ActivityThread.main(ActivityThread.java:5039)
01-30 19:29:04.142: E/ActivityThread(21292):    at java.lang.reflect.Method.invokeNative(Native Method)
01-30 19:29:04.142: E/ActivityThread(21292):    at java.lang.reflect.Method.invoke(Method.java:511)
01-30 19:29:04.142: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-30 19:29:04.142: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-30 19:29:04.142: E/ActivityThread(21292):    at dalvik.system.NativeStart.main(Native Method)
01-30 19:29:04.152: E/ActivityThread(21292): Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f2bf80 that was originally bound here
01-30 19:29:04.152: E/ActivityThread(21292): android.app.ServiceConnectionLeaked: Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f2bf80 that was originally bound here
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1418)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1407)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
01-30 19:29:04.152: E/ActivityThread(21292):    at com.google.android.youtube.player.internal.r.e(Unknown Source)
01-30 19:29:04.152: E/ActivityThread(21292):    at   com.google.android.youtube.player.YouTubeThumbnailView.initialize(Unknown Source)
01-30 19:29:04.152: E/ActivityThread(21292):    at com.reemdroid.tube.MainActivity.onCreate(MainActivity.java:132)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.Activity.performCreate(Activity.java:5104)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.os.Looper.loop(Looper.java:137)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.ActivityThread.main(ActivityThread.java:5039)
01-30 19:29:04.152: E/ActivityThread(21292):    at java.lang.reflect.Method.invokeNative(Native Method)
01-30 19:29:04.152: E/ActivityThread(21292):    at java.lang.reflect.Method.invoke(Method.java:511)
01-30 19:29:04.152: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-30 19:29:04.152: E/ActivityThread(21292):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-30 19:29:04.152: E/ActivityThread(21292):    at dalvik.system.NativeStart.main(Native Method)
01-30 19:29:04.152: E/ActivityThread(21292): Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f51090 that was originally bound here
01-30 19:29:04.152: E/ActivityThread(21292): android.app.ServiceConnectionLeaked: Activity com.reemdroid.tube.MainActivity has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@42f51090 that was originally bound here
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
01-30 19:29:04.152: E/ActivityThread(21292):    at  android.app.ContextImpl.bindService(ContextImpl.java:1418)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.ContextImpl.bindService(ContextImpl.java:1407)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
01-30 19:29:04.152: E/ActivityThread(21292):    at com.google.android.youtube.player.internal.r.e(Unknown Source)
01-30 19:29:04.152: E/ActivityThread(21292):    at com.google.android.youtube.player.YouTubeThumbnailView.initialize(Unknown Source)
01-30 19:29:04.152: E/ActivityThread(21292):    at com.reemdroid.tube.MainActivity.onCreate(MainActivity.java:145)
01-30 19:29:04.152: E/ActivityThread(21292):    at android.app.Activity.performCreate(Activity.java:5104)

Am I missing something? I see a serviceConnection, but that should be gone while releasing the YouTubeThumbnailLoader, I assume.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:41:58+00:00Added an answer on June 18, 2026 at 9:41 am

    There is one loader for every YouTubeThumbnailView. You are only saving a reference to one of them (in the field this.Loader) and you’re only releasing that one loader. You want to release all of them.

    One way to achieve this could be to keep a map from YouTubeThumbnailView to YouTubeThumbnailLoader. In onInitializationSuccess you do map.put(view, loader) and in onClick (where you release) you call .release() on all loaders in map.valueSet().

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really need some help here, we are trying to use our player over
I really need some help with this as I have been trying to fix
We Really need some help on this one: We've Struggled with all the Apple
I really need some help... When I try to get the number of cells
I would really need some help from to AJAX Guru master overthere to help
guys i really REALLY need some help on this one. 2 days i've been
I really need some help with Plone. I am experiencing some issue upgrading from
I really need some help in Regular Expressions, i'm working on a function like
I'm new to java and really need some help. I created a command line
I'm new to MySQL so I really need some help with an issue I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.