Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>don't foget to declare the progressDialog global variable </p> <pre><code> @Override public void onClick(View v) { AsyncTask&lt;Void, Void, Void&gt; task = new AsyncTask&lt;Void, Void, Void&gt;() { @Override protected void onPreExecute() { progressDialog = new ProgressDialog(getActivity()); progressDialog.setProgressStyle(R.style.NewDialog); progressDialog.setMessage("Loading..."); progressDialog.show(); } @Override protected Void doInBackground(Void... arg0) { String datafolder = Environment.getDataDirectory().getAbsolutePath()+File.separator+"app"; File customfolder=new File(Environment.getExternalStorageDirectory().getAbsolutePath().toString()+File.separator+"BackupApps"); String comando = "cp -r /data/app /sdcard/BackupApps"; Process suProcess = null; try { suProcess = Runtime.getRuntime().exec("su"); } catch (IOException e3) { // TODO Auto-generated catch block e3.printStackTrace(); } DataOutputStream os = new DataOutputStream(suProcess.getOutputStream()); try { os.writeBytes(comando + "\n"); } catch (IOException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } try { os.flush(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { os.writeBytes("exit\n"); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { os.flush(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } @Override protected void onPostExecute(Void result) { if (progressDialog!=null) { progressDialog.dismiss(); } } }; task.execute((Void[])null); </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload