私は cordova-2.4.0 を使用していますが、「share」プラグインを「src」に追加すると、「タイプ Share のメソッド execute(String, JSONArray, String) は、スーパータイプ メソッドをオーバーライドまたは実装する必要があります」というエラーが表示されます。この Java エラーを解決する方法がわかりません。エラーが発生している Java ファイルのコードは次のとおりです。
/**
*
* Phonegap share plugin for Android
* Kevin Schaul 2011
*
*/
package com.schaul.plugins.share;
import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.api.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Intent;
public class Share extends CordovaPlugin {
@Override
public PluginResult execute(String action, JSONArray args, String callbackId) {
try {
JSONObject jo = args.getJSONObject(0);
doSendIntent(jo.getString("subject"), jo.getString("text"));
return new PluginResult(PluginResult.Status.OK);
} catch (JSONException e) {
return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
}
}
private void doSendIntent(String subject, String text) {
Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
sendIntent.setType("text/plain");
sendIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
sendIntent.putExtra(android.content.Intent.EXTRA_TEXT, text);
this.cordova.startActivityForResult(this, sendIntent, 0);
}
}