use of com.squareup.leakcanary.RefWatcher in project chefly_android by chef-ly.
the class RegisterActivity method onDestroy.
@Override
protected void onDestroy() {
//unregister to listen the data
super.onDestroy();
LocalBroadcastManager.getInstance(getApplicationContext()).unregisterReceiver(mBroadcastReceiver);
if (BuildConfig.DEBUG) {
RefWatcher refWatcher = CheflyApplication.getRefWatcher(this);
refWatcher.watch(this);
}
}
use of com.squareup.leakcanary.RefWatcher in project chefly_android by chef-ly.
the class GetCookingActivity method onDestroy.
// @Override
// public void onResume(){
// super.onResume();
//
// //TODO - resume voiceRec and TTS
//
// // restart voice rec
// if (voiceRec != null) {
// voiceRec.startRec();
// }
//
// }
@Override
protected void onDestroy() {
super.onDestroy();
pager.clearOnPageChangeListeners();
// calls cancel and shutdown on the recognizer
voiceRec.killRec();
voiceRec = null;
textToSpeech.stop();
textToSpeech.shutdown();
speechListener = null;
textToSpeech = null;
// Unregister EventBus
EventBus.getDefault().unregister(this);
if (BuildConfig.DEBUG) {
RefWatcher refWatcher = CheflyApplication.getRefWatcher(this);
refWatcher.watch(this);
}
}
use of com.squareup.leakcanary.RefWatcher in project chefly_android by chef-ly.
the class IntroActivity method onDestroy.
@Override
protected void onDestroy() {
super.onDestroy();
SharedPreferences.Editor sharedPreferencesEditor = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit();
sharedPreferencesEditor.putBoolean("FirstTimeRun", true);
sharedPreferencesEditor.apply();
if (BuildConfig.DEBUG) {
RefWatcher refWatcher = CheflyApplication.getRefWatcher(this);
refWatcher.watch(this);
}
}
use of com.squareup.leakcanary.RefWatcher in project chefly_android by chef-ly.
the class RecipeListActivity method onDestroy.
@Override
protected void onDestroy() {
super.onDestroy();
// Update favorites list for user on server
if (favListAdd.size() > 0 || favListRemove.size() > 0) {
new AsyncTask<String, Integer, Integer>() {
@Override
protected Integer doInBackground(String... params) {
GsonBuilder builder = new GsonBuilder();
Gson gson = builder.create();
Type type = new TypeToken<ArrayList<Integer>>() {
}.getType();
String bodyAdd = gson.toJson(favListAdd, type);
String bodyRemove = gson.toJson(favListRemove, type);
String token = CredentialsManager.getCredentials(getApplicationContext()).getAccessToken();
if (token == null) {
token = "test";
}
Log.d(TAG, bodyAdd + " " + bodyRemove);
RequestMethod rm = new RequestMethod();
rm.setEndPoint(urlFavsString);
rm.setMethod("POST");
rm.setHeader("Authorization", "Bearer " + token);
rm.setParam("add", bodyAdd);
rm.setParam("remove", bodyRemove);
try {
HttpConnection http = new HttpConnection();
http.downloadFromFeed(rm);
} catch (IOException e) {
return 0;
}
return 200;
}
@Override
protected void onPostExecute(Integer integer) {
super.onPostExecute(integer);
}
}.execute();
}
if (BuildConfig.DEBUG) {
RefWatcher refWatcher = CheflyApplication.getRefWatcher(this);
refWatcher.watch(this);
}
}
use of com.squareup.leakcanary.RefWatcher in project chefly_android by chef-ly.
the class MainActivity method onDestroy.
@Override
protected void onDestroy() {
super.onDestroy();
if (BuildConfig.DEBUG) {
RefWatcher refWatcher = CheflyApplication.getRefWatcher(this);
refWatcher.watch(this);
}
}
Aggregations