如何在后台发送短信的Andr​​oid设备? [英] How to send SMS message on android device in the background?

查看:220
本文介绍了如何在后台发送短信的Andr​​oid设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我需要能够发送短信的后台,无需用户干预。我使用SmsManager的(code以下)来实现这一目标。它发送邮件,但弹出问我选择投放方式仍显示(将邮件发送即使)。我也有谷歌语音因而安装弹出。有没有办法对我来说,避免显示这个弹出,同时发送短信?也许我会用不同的方法?

in my app i need to be able to send a text message in a background, without users intervention. I am using SmsManager (code below) to accomplish that. It does send a message but the popup asking me to choose a delivery method still shows up (even after the message is sent). I do have Google Voice installed thus the popup. Is there a way for me to avoid displaying this popup while sending text message? Perhaps i shall use a different method?

谢谢!

SmsManager sm = SmsManager.getDefault();
sm.sendTextMessage(number, null, message, null, null);

更新:这样只是为了看看会发生什么,我选择一个默认的交付方式是短信,并勾选说以此为默认值。现在,当我使用code以上,它把它的背景,但它同时也带来了空的形式发送邮件来发送消息:|我如何摆脱呢? :)

Update: so just to see what will happen i selected a default delivery method being "text message" and check the box saying use this as default. Now when i send the message using the code above it sends it in the background but it also bring up the empty form to send a message to :| How do i get rid of this? :)

推荐答案

恢复设备和问题走了,所以一定发生了第三方应用程序,从而导致发送新邮件的形式,它现在一切都很好,短信正在发送在一个背景。感谢您的帮助所有...

restored the device and problem was gone, so must've been a third party app causing the send new message form, its all good now, sms is being send in a background. thanks for your help all...

这篇关于如何在后台发送短信的Andr​​oid设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆