Here you can find the source of rebootWipeUserData(final Context context)
public static void rebootWipeUserData(final Context context)
//package com.java2s; import java.io.IOException; import android.content.Context; import android.os.RecoverySystem; import android.util.Log; public class Main { private final static String TAG = "Upgrade.RebootUtils"; public static void rebootWipeUserData(final Context context) { Log.w(TAG, "!!! REBOOT WIPE USER DATA !!!"); // The reboot call is blocking, so we need to do it on another thread. Thread thr = new Thread("Reboot") { @Override//from w ww. j a v a 2s.c om public void run() { try { RecoverySystem.rebootWipeUserData(context); } catch (IOException e) { Log.e(TAG, "Can't perform rebootInstallPackage", e); } } }; thr.start(); } }