Android根据手机远近自动切换扬声器或听筒
智能切换听筒类型,是如今应用提升用户体验绝佳方式,下面我们就来实现,如何自动切换听筒类型,选择声音播放方式,是外放还是内放。main.xml<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:lay...