Package Manager and Action Dial on wifi device
<p>My application exposes phone dial buttons that will fire a dial intent. However I would like to hide/disable the button on wifi devices. </p>

<p>When I check on my wifi Motorola Xoom with Android 3.2 with</p>

<pre><code>  public boolean canOpenDialer() {
        PackageManager packageManager = context.getPackageManager();
        Intent testIntent = new Intent(Intent.ACTION_DIAL);
        if (packageManager.queryIntentActivities(testIntent, PackageManager.MATCH_DEFAULT_ONLY).size() &gt; 0) {
            return true;
        } else {
            return false;
        }
    }
</code></pre>

<p>the query returns true because com.android.contacts.activities.NonPhoneActivity is returned as a valid intent receiver.</p>

<p>When called this in turn brings up a UI to add the number to the contacts, but of course not a dialer. So it sort of makes sense to have this come up. However I do not know what happens on other wifi only devices. </p>

<p>So the question is should I modify the method to take that into account and leave the button live if this activity is returned as the only one but no other. Or should I just leave the button active all the time basically so removing the test.. but that would be weird on older devices potentially or e.g. the kindle fire.</p>

<p>What is the best way to deal with a call button?</p>
