【发布时间】:2014-04-14 11:02:05
【问题描述】:
我正在尝试通过一个按钮结束通话。通话结束仅在少数手机上正常工作。我如何让它在所有手机中都能正常工作?
在少数电话上,通话根本不会被切断?
这是我尝试过的:
点击 END CALL 会调用以下内容:
TelephonyManager telephony = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
try
{
// Java reflection to gain access to TelephonyManager's
// ITelephony getter
Class c = Class.forName(telephony.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
com.android.internal.telephony.ITelephony telephonyService = (ITelephony) m.invoke(telephony);
telephonyService.endCall();
finish();
timeSwapBuff += timeInMilliseconds;
customHandler.removeCallbacks(updateTimerThread);
}
catch (Exception e)
{
e.printStackTrace();
Log.e("Error", "FATAL ERROR: could not connect to telephony subsystem");
Log.e("Error", "Exception object: " + e);
}
让我知道如何解决这个问题?
谢谢!
【问题讨论】:
-
没有从上面的链接得到任何解决方案?
-
你试过
proguard那里的设置吗? -
我根本没有proguard设置?