Register an app to show in 'complete action using dialog in Android
How can I include my appl开发者_开发知识库ication in this complete action option?
Got the solution, try the below code:
<Activity>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
</Activity>
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
These options list all the apps that have an Activity registered to handle to 'call' Intent. If you want your app to appear, you'll have to create an Activity and register it for that Intent.
To do that you'll need to add a permission in your manifest
<uses-permission android:name="android.permission.CALL_PHONE" />
And add this intent filter to your activity in your manifest
<intent-filter>
<action android:name="android.intent.action.CALL_BUTTON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
To call directly escaping the dialer, try this:
Intent call = new Intent(Intent.ACTION_CALL);
call.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
call.setData(Uri.parse("tel:" + number));
startActivity(call);
Sorry I misunderstood your question. I have not tried it but I hope these two intent filter can help you:
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
精彩评论