내가 구글 백업 API에 대해 공부하는 안드로이드 응용 프로그램을 개발하고이있다 이 모든 시간을 충돌한다오류 : 둘 다 사용자 10066도 현재 프로세스 내가이 튜토리얼을 <a href="http://www.edumobile.org/android/android-development/backup-manager/" rel="nofollow">http://www.edumobile.org/android/android-development/backup-manager/</a></p> <p>를 읽고 그것을 구현하는 시도했지만 android.permission.BACKUP
로그 캣은
07-31 13:39:35.797: E/AndroidRuntime(18279): FATAL EXCEPTION: main
07-31 13:39:35.797: E/AndroidRuntime(18279): java.lang.IllegalStateException: Could not execute method of the activity
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.view.View$1.onClick(View.java:2072)
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.view.View.performClick(View.java:2408)
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.view.View$PerformClick.run(View.java:8816)
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.os.Handler.handleCallback(Handler.java:587)
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.os.Handler.dispatchMessage(Handler.java:92)
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.os.Looper.loop(Looper.java:123)
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.app.ActivityThread.main(ActivityThread.java:4633)
07-31 13:39:35.797: E/AndroidRuntime(18279): at java.lang.reflect.Method.invokeNative(Native Method)
07-31 13:39:35.797: E/AndroidRuntime(18279): at java.lang.reflect.Method.invoke(Method.java:521)
07-31 13:39:35.797: E/AndroidRuntime(18279): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
07-31 13:39:35.797: E/AndroidRuntime(18279): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
07-31 13:39:35.797: E/AndroidRuntime(18279): at dalvik.system.NativeStart.main(Native Method)
07-31 13:39:35.797: E/AndroidRuntime(18279): Caused by: java.lang.reflect.InvocationTargetException
07-31 13:39:35.797: E/AndroidRuntime(18279): at com.pref.BackupManagerExample.onRestoreButtonClick(BackupManagerExample.java:164)
07-31 13:39:35.797: E/AndroidRuntime(18279): at java.lang.reflect.Method.invokeNative(Native Method)
07-31 13:39:35.797: E/AndroidRuntime(18279): at java.lang.reflect.Method.invoke(Method.java:521)
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.view.View$1.onClick(View.java:2067)
07-31 13:39:35.797: E/AndroidRuntime(18279): ... 11 more
07-31 13:39:35.797: E/AndroidRuntime(18279): Caused by: java.lang.SecurityException: getCurrentTransport: Neither user 10066 nor current process has android.permission.BACKUP.
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.os.Parcel.readException(Parcel.java:1247)
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.os.Parcel.readException(Parcel.java:1235)
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.app.backup.IBackupManager$Stub$Proxy.getCurrentTransport(IBackupManager.java:444)
07-31 13:39:35.797: E/AndroidRuntime(18279): at android.app.backup.BackupManager.requestRestore(BackupManager.java:141)
07-31 13:39:35.797: E/AndroidRuntime(18279): ... 15 more
하고 menifest는
,369입니다<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pref"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.BACKUP" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:backupAgent="com.pref.BackupManagerExample">
<activity android:name=".Preff" />
<activity
android:name=".PrefrencesActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.google.android.backup.api_key"
android:value="AEdPqrEAAAAIo8gaMLEy1sb1bVd6Cyqs5dxPAy8qvFzfILeLWB" />
<activity
android:name=".BackupManagerExample"
android:enabled="true"/>
</application>
</manifest>
THER 오류
Resotre.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
// TODO Auto-generated method stub
가 //이 줄은이 오류에 대한 오류
mBackupManager.requestRestore(
new RestoreObserver() {
public void restoreFinished(int error) {
Log.v(TAG, "Restore finished, error = " + error);
populateUI();
}
}
);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
무엇을 할 수있는 원인을 보여줍니다 여기에있다? 어떻게 제거 할 수 있습니까?
편집
이 olny하지만 난이 코드를 사용,
https://github.com/StylingAndroid/BackupRestore
이 얼마나 백업 API의 행실을보고하고이 같은 오류를 준하지 않습니다.07-31 18:10:33.226: E/AndroidRuntime(20664): Caused by: java.lang.SecurityException: getCurrentTransport: Neither user 10072 nor current process has android.permission.BACKUP.
는 여기에서 내가
http://developer.android.com/guide/topics/data/backup.html
데이터 백업은 모든 안드로이드 장치에 사용할 수 보장되지
를 참조하십시오. 그러나 장치가 백업 전송을 제공하지 않는 경우 응용 프로그램에 나쁜 영향을주지 않습니다.내가 사용하는 장치는 삼성 갤럭시 팝입니다.
https://developers.google.com/android/backup/signup에서 앱을 등록한 적이 있습니까? – nandeesh
@nandeesh 예 –