在某些最小SDK版本为3(Android 1.5)的应用中,我可以将应用从我的Desire HD(Android 2.2)移动到SD卡中。如何使其编程实现在需要Android 1.5及更高版本时将应用移动到SD卡上。
在某些最小SDK版本为3(Android 1.5)的应用中,我可以将应用从我的Desire HD(Android 2.2)移动到SD卡中。如何使其编程实现在需要Android 1.5及更高版本时将应用移动到SD卡上。
在您的manifest.xml文件的<application>标签中添加android:installLocation="auto"属性。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.myapp" android:installLocation="auto"
android:versionCode="2" android:versionName="1.2">
这将使您的应用程序启用“移动到SD卡”按钮。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="string"
android:sharedUserId="string"
android:sharedUserLabel="string resource"
android:versionCode="integer"
android:versionName="string"
android:installLocation=["auto" | "internalOnly" | "preferExternal"] >
</manifest>
参考链接:点击此处