9

I want to open Backup and reset in Android Setting. For example If you want to open Wi-Fi in Android settings you can use this code :

getApplicationContext().startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));

But I found nothing that could help me to open Backup and reset. Has anyone seen any implementations of how to do that?

Milad Faridnia
  • 9,113
  • 13
  • 65
  • 78
  • 1
    May this help you in some way, http://stackoverflow.com/questions/4798788/android-factory-reset-programmatically – Apurva Feb 28 '15 at 12:07
  • thanks a lot @Apurva but i do not want to do reset programmatically. I just want to open back up and reset. ;) – Milad Faridnia Feb 28 '15 at 12:47

4 Answers4

7

I know this is old, But you can open Backup and Reset with this intent

Intent backupIntent = new Intent(Settings.ACTION_PRIVACY_SETTINGS);
startActivity(backupIntent);
Milad Faridnia
  • 9,113
  • 13
  • 65
  • 78
Bach Vu
  • 2,298
  • 1
  • 15
  • 19
  • It works up to Android 9. With version 10 Privacy Settings activity will be opened but there is no backup settings – hidd Sep 02 '20 at 16:31
2

As for the latest Android Q Beta release, the accepted answer should not be valid anymore.

The Backup feature has now been moved to the System settings group (same as date/hour settings and so on).

pizza67
  • 121
  • 1
  • 4
1

Just Looking at Settings Reference docs, there is NO Direct intent to OPEN the Backup and Reset Settings directly using Intent mechanism!

AADProgramming
  • 6,077
  • 11
  • 38
  • 58
  • Yea, I've seen that class before. I just hope that maybe there is a way to do that. ;) – Milad Faridnia Feb 28 '15 at 12:26
  • I've reached my daily vote limit. I'll upvote your answer tomorrow but still hope to find a better answer ;) – Milad Faridnia Feb 28 '15 at 12:30
  • 1
    If it is NOT documented in developer.android.com, I guess it is fair to assume it is not there!! Otherwise, Google must have documented it as they did for all other activities in Settings API – AADProgramming Feb 28 '15 at 12:32
  • Yes!! I am just out of Curious, what exactly are you trying to achieve? if you are trying to RESET Programatically, then there is a way using http://developer.android.com/guide/topics/admin/device-admin.html :) – AADProgramming Feb 28 '15 at 12:37
1

This worked for me to open backup and restore programmatically. Tested on S8 and Essential PH-1

Intent intent = new Intent();
intent.setComponent(new ComponentName("com.android.settings", "com.android.settings.Settings$PrivacySettingsActivity"));
if (intent.resolveActivity(context.getPackageManager()) != null) {
   context.startActivity(intent);
}
Vadiraj Purohit
  • 898
  • 8
  • 20