Search in sources :

Example 1 with NoteManager

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();
}
Also used : Account(android.accounts.Account) NoteManager(ca.etsmtl.applets.etsmobile.util.NoteManager) AccountManager(android.accounts.AccountManager) Intent(android.content.Intent) Editor(android.content.SharedPreferences.Editor) ProfilManager(ca.etsmtl.applets.etsmobile.util.ProfilManager)

Example 2 with NoteManager

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);
    }
}
Also used : Bundle(android.os.Bundle) NoteManager(ca.etsmtl.applets.etsmobile.util.NoteManager)

Example 3 with NoteManager

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;
}
Also used : ListeDeCours(ca.etsmtl.applets.etsmobile.model.ListeDeCours) ViewGroup(android.view.ViewGroup) ListeDeSessions(ca.etsmtl.applets.etsmobile.model.ListeDeSessions) NoteManager(ca.etsmtl.applets.etsmobile.util.NoteManager)

Aggregations

NoteManager (ca.etsmtl.applets.etsmobile.util.NoteManager)3 Account (android.accounts.Account)1 AccountManager (android.accounts.AccountManager)1 Intent (android.content.Intent)1 Editor (android.content.SharedPreferences.Editor)1 Bundle (android.os.Bundle)1 ViewGroup (android.view.ViewGroup)1 ListeDeCours (ca.etsmtl.applets.etsmobile.model.ListeDeCours)1 ListeDeSessions (ca.etsmtl.applets.etsmobile.model.ListeDeSessions)1 ProfilManager (ca.etsmtl.applets.etsmobile.util.ProfilManager)1