Exception on getSystemService(Context.AUDIO_SERVICE)

后端 未结 5 791
渐次进展
渐次进展 2021-01-16 14:39

I wanted to create an app that drops an incoming call based on some settings, that seems to be impossible on Android 1.6. So I decided to write an app that changes the Ringe

5条回答
  •  北海茫月
    2021-01-16 15:37

    E/AndroidRuntime(  356): java.lang.NullPointerException
    E/AndroidRuntime(  356):    at android.content.ContextWrapper.getSystemService(ContextWrapper.java:335)
    E/AndroidRuntime(  356):    at tml.v1.Service.TMLService.ManageIncomingCall(TMLService.java:94)
    

    You are getting a NullPointerException at line 94 of TMLService.java, I am guessing that this is the line where you call:

    audioManage.setRingerMode(AudioManager.RINGER_MODE_SILENT);
    

    and I am guessing that audioManage is null.

提交回复
热议问题