Java Code Examples for android.app.Activity#MODE_PRIVATE

The following examples show how to use android.app.Activity#MODE_PRIVATE . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public static void saveCommonData(Context context, VariablesJson variables) {
//		ZogUtils.printLog(ClanBaseUtils.class, "response:" + response);
        try {
            SharedPreferencesUtils sharedPreferencesUtils = new SharedPreferencesUtils(
                    context, Key.FILE_PREFERENCES,
                    Activity.MODE_PRIVATE);

            if (sharedPreferencesUtils != null && variables != null
                    && variables.getVariables() != null) {
                if (variables
                        .getVariables().getFormhash() != null) {
                    sharedPreferencesUtils.saveSharedPreferences("formhash", variables
                            .getVariables().getFormhash());
                }
                sharedPreferencesUtils.saveSharedPreferences("cookiepre", variables
                        .getVariables().getCookiepre());
            }
        } catch (Exception e) {
            ZogUtils.printError(BaseHttp.class, "WARNING!!!!!!!! saveCommonData() ERROR!");
        }

    }
 
Example 2
public long count(){
    SharedPreferences shared=NotificationTiming.super.getSharedPreferences(FILENAME,Activity.MODE_PRIVATE);
    int hour=shared.getInt("hour", 20);
    int min=shared.getInt("min", 0);

    if(hour==-1){
        return -1;
    }

    btn_time_setting.setText("图书到期提醒(前一天" +formate(hour,min)+")");

    Calendar ca = Calendar.getInstance();
    int h=ca.get(Calendar.HOUR_OF_DAY);//24小时制小时
    int m=ca.get(Calendar.MINUTE);//分

    if((howlong=(hour-h)*60*60*1000+(min-m)*60*1000)<0)
        howlong+=dailytime;

    Log.v("howlong",howlong+"");
    return howlong;
}
 
Example 3
public static String getFormhash(Context context) {
    SharedPreferencesUtils sharedPreferencesUtils = new SharedPreferencesUtils(
            context, Key.FILE_PREFERENCES,
            Activity.MODE_PRIVATE);
    String formhash = sharedPreferencesUtils
            .loadStringSharedPreference("formhash");
    ZogUtils.printLog(ClanBaseUtils.class, "formhash:" + formhash);
    return formhash;
}
 
Example 4
public void setShare(int mHour,int mMin){
    SharedPreferences share=NotificationTiming.super.getSharedPreferences(FILENAME,Activity.MODE_PRIVATE);
    SharedPreferences.Editor editor=share.edit();
    editor.putInt("hour",mHour);
    editor.putInt("min",mMin);
    editor.putInt("date",1);//提前几天通知,留着这东西在,还没完善
    editor.commit();
}