Very Basically I have an image I have converted into a Base64 string. The following code is how it is turned into a base64string and how im trying to return it. It is a modification of a phonegap plugin so please excuse the naming of certain things. 

```
package org.apache.cordova;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.cordova.api.Plugin;
import org.apache.cordova.api.PluginResult;
import org.json.JSONArray;

import android.annotation.TargetApi;
import android.graphics.Bitmap;
import android.os.Environment;
import android.util.Base64;
import android.view.View;

public class Screenshot extends Plugin {

    @Override

    public PluginResult execute(String action, JSONArray args, String callbackId) {
        // starting on ICS, some WebView methods
        // can only be called on UI threads
        final Plugin that = this;
        final String id = callbackId;
        super.cordova.getActivity().runOnUiThread(new Runnable() {
            //@Override
            @TargetApi(8)
            public void run() {
                View view = webView.getRootView();

                view.setDrawingCacheEnabled(true);
                Bitmap bitmap = Bitmap.createBitmap(view.getDrawingCache());
                view.setDrawingCacheEnabled(false);

                File folder = new File(Environment.getExternalStorageDirectory(), "Pictures");
                if (!folder.exists()) {
                    folder.mkdirs();

                }

                File f = new File(folder, "screenshot_" + System.currentTimeMillis() + ".png");
                System.out.println(folder);
                System.out.println("screenshot_" + System.currentTimeMillis() + ".png");

                ByteArrayOutputStream baos = new ByteArrayOutputStream();  
                bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);
                byte[] b = baos.toByteArray();
                String base64String = Base64.encodeToString(b, Base64.DEFAULT);
                String mytextstring = "data:image/png;base64,"+base64String;
                System.out.println(mytextstring);

                that.success(new PluginResult(PluginResult.Status.OK), mytextstring);
            }
        });

        PluginResult imageData = new PluginResult(PluginResult.Status.NO_RESULT);
        imageData.setKeepCallback(true);
        System.out.println("imageData:==================================================================================>>>>>"+imageData);
        return imageData;
    }

}

```

This line:

```
System.out.println(mytextstring);

```

outputs the base64 string, however this line:

```
System.out.println("imageData:==================================================================================>>>>>"+imageData);

```

doesn't. I'm trying to get imageData to contain the base64string to I can return that and use it in some Javascript. i have played about with the code for a while now with no success, I am new to Java so really don't know how close I am. Can anyone guide me please?

**EDIT** Simply all I want to do is return the Base64String, nothing else.