Android Open Source - guides Delete Guide Book Task

From Project

Back to project page guides.


The source code is released under:

GNU General Public License

If you think the Android project guides listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.adrguides;
/*  w w w.ja v  a  2 s  .co m*/
import android.content.Context;
import android.os.AsyncTask;
import android.widget.Toast;

import com.adrguides.model.Guide;

import org.json.JSONException;


 * Created by adrian on 4/11/13.
public class DeleteGuideBookTask extends AsyncTask<GuideBookItem, Void, String> {
    private Context appcontext;

    public DeleteGuideBookTask(Context appcontext) {
        this.appcontext = appcontext;

    protected String doInBackground(GuideBookItem... params) {

        GuideBookItem item = params[0];

        // Delete the folder that contains the saved guidebook
        File f = new File(item.getFolder());
        File[] bmps = f.listFiles();
        for (File b: bmps) {

        return appcontext.getString(R.string.msg_guidebook_deleted, item.getTitle());

    protected void onPostExecute(String result) {
        Toast toast = Toast.makeText(appcontext, result, Toast.LENGTH_SHORT);;

Java Source Code List