package Util;import android.app.Application;import android.content.Context;public class MyApplication extends Application {    private static Context context;@Overridepublic void onCreate() {// TODO Auto-generated method stubcontext = getApplicationContext();}public static Context getContext(){return context;}}//别忘记在androidManifest.xml文件中<application>标签中指定能属性该类的全路径//如android:name="Util.MyApplication"

更多相关文章

  1. android 读中文文本文件
  2. 调用摄像头拍照并显示
  3. android自定义一圆角ImageView
  4. android路径获取
  5. Android(安卓)中的各种路径汇总
  6. Android存储路径
  7. Android各文件存储路径汇总
  8. android studio网络图片浏览器
  9. Android(安卓)ExpandableListView使用小结(一)

随机推荐

  1. [置顶] Android的AlertDialog详解
  2. Android(安卓)Debug Tools
  3. 2018 I/O Android(安卓)详解
  4. Android中Listview通过适配器设置Item的
  5. Android工程中配置OpenCV
  6. 自动化测试 Appium之Python运行环境搭建
  7. [置顶] Android——编译安装Module的控制
  8. Android(安卓)system document
  9. Android(安卓)6.0 Marshmallow root 方法
  10. Android使用饺子播放器播放服务器端的视