use of ca.etsmtl.applets.etsmobile.util.NoteManager in project ETSMobile-Android2 by ApplETS.
the class ApplicationManager method deconnexion.
public static void deconnexion(final Activity activity) {
final Editor editor = PreferenceManager.getDefaultSharedPreferences(activity).edit();
editor.clear();
editor.commit();
// Enlever le profil de la DB SQLite
new ProfilManager(activity).removeProfil();
new NoteManager(activity).remove();
AccountManager accountManager = AccountManager.get(activity);
Account[] accounts = accountManager.getAccountsByType(Constants.ACCOUNT_TYPE);
for (int index = 0; index < accounts.length; index++) {
accountManager.removeAccount(accounts[index], null, null);
}
ApplicationManager.userCredentials = null;
Intent intent = new Intent(activity, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
activity.startActivity(intent);
new Thread(new Runnable() {
@Override
public void run() {
activity.finish();
}
}).start();
}
use of ca.etsmtl.applets.etsmobile.util.NoteManager in project ETSMobile-Android2 by ApplETS.
the class NotesDetailsFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
Bundle bundle = getArguments();
sigle = bundle.getString(SIGLE);
cote = bundle.getString(COTE);
session = bundle.getString(SESSION);
sessionAbrege = bundle.getString(SESSIONABREGE);
groupe = bundle.getString(GROUPE);
titreCours = bundle.getString(TITLECOURS);
id = sigle + sessionAbrege;
System.out.print(titreCours);
mNoteManager = new NoteManager(getActivity());
mNoteManager.addObserver(this);
}
}
use of ca.etsmtl.applets.etsmobile.util.NoteManager in project ETSMobile-Android2 by ApplETS.
the class NotesFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
ViewGroup v = (ViewGroup) inflater.inflate(R.layout.fragment_note, container, false);
super.onCreateView(inflater, v, savedInstanceState);
mListView = (ListView) v.findViewById(R.id.activity_note_listview);
listeDeCours = new ListeDeCours();
listeDeSessions = new ListeDeSessions();
mNoteManager = new NoteManager(getActivity());
mNoteManager.addObserver(this);
mapNoteACeJour = new HashMap<>();
loadingView.showLoadingView();
refreshList();
dataManager.getDataFromSignet(SignetMethods.LIST_COURS, ApplicationManager.userCredentials, this, "");
dataManager.getDataFromSignet(SignetMethods.LIST_SESSION, ApplicationManager.userCredentials, this, "");
AnalyticsHelper.getInstance(getActivity()).sendScreenEvent(getClass().getSimpleName());
return v;
}
Aggregations