Android 语音邮件合同代码:
public void voiceMail(Context ctx) {
if (Build.VERSION.SDK_INT >= 14) {
try {
final String selection = VoicemailContract.Voicemails.IS_READ + "=0";
final String sortOrder = VoicemailContract.Voicemails.DATE + " DESC";
String uri = VoicemailContract.Voicemails.CONTENT_URI + "?"
+ VoicemailContract.PARAM_KEY_SOURCE_PACKAGE + "="
+ getPackageName();
Cursor cursor = ctx.getContentResolver().query(Uri.parse(uri), null,
selection, null, sortOrder);
TextView tv = (TextView)findViewById(R.id.textView1);
tv.setText("You have "+cursor.getCount()+" voice mail");
cursor.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
它总是向我显示 0 个语音邮件,我也想集成谷歌语音邮件,提前谢谢