Hide Leaks launcher icon

This commit is contained in:
wb9688 2020-10-07 12:56:22 +02:00
parent bc342b9b33
commit ca9fbe2f11
5 changed files with 27 additions and 1 deletions

View file

@ -2,9 +2,24 @@ package org.schabi.newpipe.settings;
import android.os.Bundle;
import androidx.annotation.Nullable;
import org.schabi.newpipe.R;
import leakcanary.LeakCanary;
public class DebugSettingsFragment extends BasePreferenceFragment {
@Override
public void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
findPreference(getString(R.string.show_memory_leaks_key))
.setOnPreferenceClickListener(preference -> {
startActivity(LeakCanary.INSTANCE.newLeakDisplayActivityIntent());
return true;
});
}
@Override
public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {
addPreferencesFromResource(R.xml.debug_settings);