SurfaceView中的getSystemService

来源:互联网 发布:动态规划矩阵连乘问题 编辑:程序博客网 时间:2024/06/05 10:25
今天想通过在SurfaceView中取得一个AudioManager对象,可是总是报错,源码为Manageram=(AudioManager)getSystemService(Context.AUDIO_SERVICE);在别人的帮助之下,原来要在前面加上context,为Manageram=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);呵呵,花了我不少时间呢。