这几天携程小伙伴终面遇到这样一道题,写出一段从短信内容跳转打开app的代码实例,当时我就懵逼了。在网上搜了良久,终于在stackoverflow找到解决方案:
Launch Android app from within SMS/MMS message?
假设,我们想打开http://test.com/myapp
,只需要在AndroidManifest文件的入口activity中添加一段intent-filter,如下:
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAU