@Override protected Void doInBackground(Void... args) { try { DataFramework.getInstance().open(context, Utils.packageName); } catch (Exception e) { e.printStackTrace(); } ConnectionManager.getInstance().open(context); twitter = ConnectionManager.getInstance().getUserForSearchesTwitter(); PreferenceManager.setDefaultValues(context, R.xml.preferences, false); preferences = PreferenceManager.getDefaultSharedPreferences(context); try { if (!PreferenceUtils.getStatusWorkApp(context)) { searchUser(); } if (!PreferenceUtils.getStatusWorkApp(context)) { searchNotifications(); } if (!PreferenceUtils.getStatusWorkApp(context)) { writeADWLauncher(); } if (!PreferenceUtils.getStatusWorkApp(context)) { shouldSendNotificationAndroid(); } } catch (Exception e) { e.printStackTrace(); PreferenceUtils.saveStatusWorkAlarm(context, false); } finally { PreferenceUtils.saveStatusWorkAlarm(context, false); } DataFramework.getInstance().close(); PreferenceUtils.saveStatusWorkAlarm(context, false); WidgetCounters2x1.updateAll(context); WidgetCounters4x1.updateAll(context); Log.d(Utils.TAG_ALARM, "Finalizado notificaciones en background"); return null; }
public void loadUser(long id) { twitter = ConnectionManager.getInstance().getTwitter(id); }