how to verify shortcut installation on android -
i have issue need clarification with. creating shortcut following code:
intent intent = new intent(); intent.putextra("duplicate",false); intent.putextra(intent.extra_shortcut_intent, myotherintent); intent.putextra(intent.extra_shortcut_name, ((edittext) findviewbyid(r.id.text1)).gettext().tostring()); intent.putextra(intent.extra_shortcut_icon_resource,intent.shortcuticonresource.fromcontext(this, r.drawable.ic_launcher)); intent.setaction("com.android.launcher.action.install_shortcut"); sendorderedbroadcast(intent, null,new broadcastreceiver(){ @override public void onreceive(context context, intent intent) { log.d("in broadcast process","isorderedbroadcast:"+isorderedbroadcast()+"/"+system.currenttimemillis()); log.d("in broadcast process","resultcode:"+getresultcode()+":"+getresultdata()); } }, null, activity.result_ok, null, null);
i have 2 issues trying work through.
1) can verify icon created or not. (return code success when icon not created due lack of available space) 2) can detect shortcuts exist or verify existence of icon on homescreen?
can verify icon created or not
no.
can detect shortcuts exist or verify existence of icon on homescreen?
no. bear in mind not home screen implementations honor broadcast, there no requirement so. adding shortcut home screen welcome try, cannot rely upon being supported on given device.
Comments
Post a Comment