Android - receiving long SMS (multipart)

后端 未结 5 1904
南旧
南旧 2020-11-30 03:04

I have an application, which has to listen for specific SMS. So far easy.

But when I receive the message, it\'s multipart. Is there a proper way to receive the SMS

5条回答
  •  既然无缘
    2020-11-30 03:48

    Yes you should concatenate the SMS by hand, but obviously you don't want to be starting up a new activity for each message segment.

    I suggest setting your Activity's launchMode attribute to singleTask or singleInstance so that that doesn't happen.

    Alternatively have your SMS's received by a Service, which will fire up a new Activity only once it has a complete message.

提交回复
热议问题