关于this.context=context语句

               我们在Android开发中经常会用到context上下文环境,如果你是用一个类去继承一个接口,我们暂且把方法名定为VoicePlayer(),那么继承完会有如下语句:

public VoicePlayer(Context context){},因为要用到context,所以要先初始化它,private Context context; 并在方法里写上this.context=context 


你可能感兴趣的:(android开发)