Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
import android.app.Activity; import android.content.Context; import android.media.AudioManager; import android.os.Bundle; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import com.android.internal.telephony.ITelephony; //yeah, get the interface! import android.telephony.*; private TelephonyManager m_telephonyManager; private ITelephony m_telephonyService; private PhoneStateListener m_phoneStateListener; private AudioManager m_audioManager; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); m_telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); Class c = null; try { c = Class.forName(m_telephonyManager.getClass().getName()); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } Method m = null; try { m = c.getDeclaredMethod("getITelephony"); } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (NoSuchMethodException e) { // TODO Auto-generated catch block e.printStackTrace(); } m.setAccessible(true); try { m_telephonyService = (ITelephony)m.invoke(m_telephonyManager); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } //You can also replace above 4 lines of statements to //m_telephonyService = ITelephony.Stub.asInterface(ServiceManager.getService(Context.TELE m_audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); m_telephonyManager.listen(new MyPhoneStateListener(), PhoneStateListener.LISTEN_CALL_STATE); } class MyPhoneStateListener extends PhoneStateListener { public void onCallStateChanged(int state, String incomingNumber) { m_audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT); switch (state) { case TelephonyManager.CALL_STATE_IDLE: m_audioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); break; case TelephonyManager.CALL_STATE_OFFHOOK: //CALL_STATE_OFFHOOK; break; case TelephonyManager.CALL_STATE_RINGING: if (true) // if incomingNumber need to be blocked { m_telephonyService.answerRingingCall(); } else { m_audioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); } break; default: break; } } }