send data back to javascript from phonegap java plugin
===

I want to send data from java plugin to javascript which calls my java plugin.But when control goes to "result = new PluginResult(PluginResult.Status.NO_RESULT);" i am getting JSCallback error. I am using cordova-1.8.1. Below is the java code....Please help..

 

       public PluginResult execute(String action, JSONArray arg1, String callbackId) {
		 PluginResult result= null;
		Log.d("Importfile","value of arg "+ callbackId);
		if (action.equals("importdata")){				
			callBackId=callbackId;	
			importdata();
			result = new PluginResult(PluginResult.Status.NO_RESULT);
		 	result.setKeepCallback(true);
		} else {
			result = new PluginResult(Status.INVALID_ACTION);
			Log.d("Importfile","Invalid Action");           	}
	
		return result;
	}
    private void importdata(){
	String line = "";
	PluginResult result = null;
	line="Data returned from plugin";
		try      {
            JSONObject dataJSON = new JSONObject();
            dataJSON.put("data",line);
            result = new PluginResult(Status.OK, dataJSON);
        }catch(JSONException jsonobj){
        	jsonobj.printStackTrace();	
        }
		result.setKeepCallback(true);
	this.success(result,this.callBackId);
    }

**Below is my javascript code...**


    var Importdata = function(){};
 
    Importdata.prototype.getdata = function(success, failure)
    {
	   
	     cordova.exec(success, failure,'Importfile', 'importdata', []);
	
    };
    cordova.addConstructor(function()
		{
	cordova.addPlugin("Importdata", new Importdata());
		});

    **HTML code**
    <script>
    function test(){
	window.plugins.Importdata.getdata(
	function(result){
	displaydata(result);
	},

	function(error){
		displaydata(error);
	}
	);

    function diaplaydata(result){

		console.log("Returned data"+ result);

	}

     }


