android中的activity里获得context方法
2014-08-06 22:51
239 查看
activity的方法中用getBaseContext();
在activity中用this即可
Context context=getBaseContext();
在activity中用this即可
FileService fileService=new FileService(this);
public class FileService { private Context context; public FileService() { super(); } public FileService(Context context) { this.context=context; }
相关文章推荐
- android中的activity里获得context方法
- Android中Activity全局共享方法AppContext
- Android中Activity全局共享方法AppContext
- Android获得当前正在显示的activity类名的方法
- mono for android Listview 里面按钮 view Button click 注册方法 并且传值给其他Activity 主要是context
- Android获取其他包的Context实例,然后调用它的方法
- Android Service 通知Activity更新界面的方法研究
- android2.2中关闭程序中所有activity方法
- Android application context/activity context与内存泄露
- android程序退出当前activity的方法
- Android中2个activity之间的数据传递方法
- context.startActivity出现AndroidRuntimeException
- Android中Activity共享变量的另一方法:Application context
- Android application context/activity context与内存泄露(转)
- 【转】Android TabActivity无法正常bindService解决方法
- Android Service 通知Activity更新界面的方法研究
- Activity设置全屏以及Android获得屏幕的宽和高
- 在一个Activity bull中启动另一个Activity secondbull的方法 3 启动package *com.example.android.notepad 中的类bull*
- Android退出一个多Activity应用程序的方法
- Android application context/activity context与内存泄露