判断手机是不是有语音识别功能

        PackageManager pm = getPackageManager();
        List activities = pm.queryIntentActivities(
                new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
        if (activities.size() != 0) {
            /*Activity  存在*/
        	Toast.makeText(AndroidVoiceActivity.this, "Activity  存在", Toast.LENGTH_LONG).show();
        } else {
            /*  Activity  Not  Found   未判断会抛出ActivityNotFoundException*/
        	Toast.makeText(AndroidVoiceActivity.this, "Activity  不存在", Toast.LENGTH_LONG).show();
        }

 

你可能感兴趣的:(判断手机是不是有语音识别功能)