안드로이드-인텐트로 객체 넘기기(How to pass the object for intent?)

전달자

@PluginMethod
    public void setRegNumber(PluginCall call) throws JSONException {
        JSObject jsObject = new JSObject();
        List<String> numberList = call.getArray("regNumber").toList();

        Log.v("CallTest","받은 List : "+numberList);

        Intent intent = new Intent(getContext(),PhoneCallReceiver.class);
        intent.putExtra("state","initialize");
        intent.putExtra("value",(Serializable) numberList);
        getContext().sendBroadcast(intent);

        jsObject.put("result", "등록완료");
        call.resolve(jsObject);
    }

받는쪽

state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
if(state.equals("initialize")){
     Serializable phoneNumber = intent.getSerializableExtra("value");
     ArrayList<String> list = (ArrayList<String>)phoneNumber;
     Log.v("CallTest","폰 번호 : "+list);
}