Exception on getSystemService(Context.AUDIO_SERVICE)

后端 未结 5 893
渐次进展
渐次进展 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:18

    public void ManageIncomingCall(String incomingNumber)  
    {
        super.onCreate();
        AudioManager audioManage = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
        audioManage.setRingerMode(AudioManager.RINGER_MODE_SILENT);
    }
    

    Why Are you calling super.onCreate() in a method other than onCreate()? That sounds really, really wrong.

提交回复
热议问题