android - Are there any examples of Service which handles ACTION_RESPONSE_VIA_MESSAGE -


trying make app default sms app (as required in kitkat). instructions pretty clear, instead point:

in service, include intent filter action_response_via_message ("android.intent.action.respond_via_message") schemas, sms:, smsto:, mms:, , mmsto:. service must require send_respond_via_message permission.

can't understand how write service? have tried follow android sources it's still unclear.

anyone can point me example how works?

example of sms app register intent :

protected void onhandleintent(intent intent) {         if (intent != null) {             if (telephonymanager.action_respond_via_message.equals(intent.getaction())) {                 string num = intent.getdatastring();                 num = num.replace("smsto:", "").replace("sms:", "");                 string msg = intent.getstringextra(intent.extra_text);                 // send data via intent                 intent intentservice = new intent(this, someclass.class);                 startservice(intentservice);             }         }     } 

sending msg via smsmaneger - smsmanager.sendtextmessage(address, null, msg, pisent, pidelivered);


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -