context 的理解

Android中Context简介

Context字面意思是上下文,位于framework package的android.content.Context中,其实该类为LONG型,类似Win32

中的Handle句柄。很多方法需要通过 Context才能识别调用者的实例:比如说Toast的第一个参数就是Context,一般

//在Boy class 类中,构造函数

public Boy(Context mContext ) {

//这里将Context转换为Activity.
mActivity = (Activity)mContext;

posted on 2013-03-14 11:09  Code大蛇丸  阅读(276)  评论(0)    收藏  举报