on android how to hide dial screen and open my application on the top when user click on dial button? -
i creating application contains list on numbers, when user click on number application make call chosen number. example if have code bellow if user click on number dialling screen apear on top of application . can make same task keepping application on top , make call witout showing dillaing screen ? :
package com.example.saira_000.myapplication; import android.manifest; import android.content.intent; import android.content.pm.packagemanager; import android.net.uri; import android.os.bundle; import android.support.v4.app.activitycompat; import android.support.v7.app.appcompatactivity; import android.view.view; import android.widget.button; public class mainactivity extends appcompatactivity { private button button; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); button = (button) findviewbyid(r.id.buttoncall); button.setonclicklistener(new view.onclicklistener() { public void onclick(view arg0) { intent callintent = new intent(intent.action_call); callintent.setdata(uri.parse("tel:0377778888")); if (activitycompat.checkselfpermission(mainactivity.this, manifest.permission.call_phone) != packagemanager.permission_granted) { return; } startactivity(callintent); } }); } }
Comments
Post a Comment