1
public PluginResult execute(String action, JSONArray args, String callbackId) {
try {
Intent intent = new Intent(Intent.ACTION_HEADSET_PLUG);
String nm = intent.getStringExtra("name");
String st1 = intent.getStringExtra("state");
Log.v("nikhil","i="+intent+" name="+nm+" 2="+st1);
return new PluginResult(PluginResult.Status.OK);
} catch(Exception e) {
Log.e("MailApp", "Could not send email", e);
}
return null;
}
nm 및 st1은 항상 null이됩니다. 헤드셋이 연결되어있는 경우에도 !!!Intent.ACTION_HEADSET_PLUG null null