我只是想向自己发送一个简单的文本..当然,例外是 java.lang.SecurityException: Sending SMS message: uid 10263 does not have android.permission.SEND_SMS
这就是我的清单文件的样子
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.homesafe"
android:versionCode="1"
android:versionName="1.0"
android:permission="android.permission.SEND_SMS">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19"
/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
>
<activity
android:name="com.example.homesafe.MainActivity"
android:label="@string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
现在,它在Manifest
标记下..但是即使我将许可移到application
标记下,我仍然会遇到相同的错误。我很困惑..
您需要做的就是:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.homesafe"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19"
/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
>
<activity
android:name="com.example.homesafe.MainActivity"
android:label="@string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句