package com.jcf.utilsdemo; import android.content.Context; import android.content.res.Resources; public class ResourceUtils { public static int getDrawableId(Context context, String name) { Resources res = context.getResources(); return res.getIdenti…
获取全局上下文(getApplicationContext)_创建Shared Preference工具类_实现自动登录 ===========================获取全局上下文(getApplicationContext)======================== 1.在com.example.autologin.myapplication包中创建Myapplication extends Application 代码: public class Myapplication…