Search in sources :

Example 21 with RefWatcher

use of com.squareup.leakcanary.RefWatcher in project CoCoin by Nightonke.

the class CustomViewFragment method onDestroy.

@Override
public void onDestroy() {
    super.onDestroy();
    RefWatcher refWatcher = CoCoinApplication.getRefWatcher(getActivity());
    refWatcher.watch(this);
}
Also used : RefWatcher(com.squareup.leakcanary.RefWatcher)

Example 22 with RefWatcher

use of com.squareup.leakcanary.RefWatcher in project CoCoin by Nightonke.

the class MonthViewFragment method onDestroy.

@Override
public void onDestroy() {
    super.onDestroy();
    RefWatcher refWatcher = CoCoinApplication.getRefWatcher(getActivity());
    refWatcher.watch(this);
}
Also used : RefWatcher(com.squareup.leakcanary.RefWatcher)

Example 23 with RefWatcher

use of com.squareup.leakcanary.RefWatcher in project MVPArms by JessYanCoding.

the class WEFragment method onDestroy.

@Override
public void onDestroy() {
    super.onDestroy();
    //使用leakCanary检测fragment的内存泄漏
    RefWatcher watcher = WEApplication.getRefWatcher(getActivity());
    if (watcher != null) {
        watcher.watch(this);
    }
    this.mWeApplication = null;
}
Also used : RefWatcher(com.squareup.leakcanary.RefWatcher)

Example 24 with RefWatcher

use of com.squareup.leakcanary.RefWatcher in project chefly_android by chef-ly.

the class RecipeDetailActivity method onDestroy.

@Override
protected void onDestroy() {
    super.onDestroy();
    DatabaseHandler db = new DatabaseHandler(getApplicationContext());
    // Remove an item from shopping list if removed by clicking on ingredient
    ArrayList<ShoppingListItem> existing = db.getShoppingList();
    ArrayList<ShoppingListItem> toDelete = new ArrayList<>();
    for (ShoppingListItem item : existing) {
        if (!shoppingList.contains(item)) {
            toDelete.add(item);
        }
    }
    db.deleteItemFromShoppingList(toDelete);
    // Add new items to shopping list
    for (ShoppingListItem item : shoppingList) {
        if (item.getId() == -9999) {
            db.addItemToShoppingList(item.getName(), item.isPurchased());
        }
    }
    if (BuildConfig.DEBUG) {
        RefWatcher refWatcher = CheflyApplication.getRefWatcher(this);
        refWatcher.watch(this);
    }
}
Also used : DatabaseHandler(com.se491.chef_ly.Databases.DatabaseHandler) ArrayList(java.util.ArrayList) RefWatcher(com.squareup.leakcanary.RefWatcher) ShoppingListItem(com.se491.chef_ly.model.ShoppingListItem)

Example 25 with RefWatcher

use of com.squareup.leakcanary.RefWatcher in project chefly_android by chef-ly.

the class ListViewFragment method onDestroy.

@Override
public void onDestroy() {
    super.onDestroy();
    if (BuildConfig.DEBUG) {
        RefWatcher refWatcher = CheflyApplication.getRefWatcher(getContext());
        refWatcher.watch(this);
    }
}
Also used : RefWatcher(com.squareup.leakcanary.RefWatcher)

Aggregations

RefWatcher (com.squareup.leakcanary.RefWatcher)62 SharedPreferences (android.content.SharedPreferences)2 IOException (java.io.IOException)2 Manifest (android.Manifest)1 Application (android.app.Application)1 ContentProviderOperation (android.content.ContentProviderOperation)1 ContentUris (android.content.ContentUris)1 ContentValues (android.content.ContentValues)1 PackageManager (android.content.pm.PackageManager)1 Environment (android.os.Environment)1 StrictMode (android.os.StrictMode)1 MediaStore (android.provider.MediaStore)1 NonNull (android.support.annotation.NonNull)1 ContextCompat (android.support.v4.content.ContextCompat)1 PreferenceManager (android.support.v7.preference.PreferenceManager)1 TelephonyManager (android.telephony.TelephonyManager)1 TextUtils (android.text.TextUtils)1 Log (android.util.Log)1 Collectors (com.annimon.stream.Collectors)1 Stream (com.annimon.stream.Stream)1