(通过说接收器,我指的是正常听到电话时的部分。) 有人给了下面的代码片,但是没有用。有什么帮助吗?
Object obj = new Object();
Method method;
try {
method = Class.forName("android.media.AudioSystem").getMethod(
"setDeviceConnectionState", new Class[] { Integer.TYPE,Integer.TYPE,
String.class });
method.invoke(obj, new Object[] {num,1,""});
} catch (Exception e) {
e.printStackTrace();
Log.i(TAG, e.toString());
}
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.content.Intent.ACTION_VIEW);
String type = getMIMEType(f);
intent.setDataAndType(Uri.fromFile(f), type);
startActivity(intent);
答案 0 :(得分:0)
m_amAudioManager.setMode(AudioManager.MODE_IN_CALL);