android: how can I verify, that device support multitouch?

元气小坏坏 提交于 2019-11-30 17:34:54

If you need multitouch, include:

<uses-feature android:name="android.hardware.touchscreen.multitouch" />

in your manifest. Your application will not be listed in the Market for devices that lack multitouch.

If you wish to conditionally support multitouch, use PackageManager and hasSystemFeature() to see if android.hardware.touchscreen.multitouch is available.

A quick example:

boolean multi = 
getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);
public final String SUPPORT = "Supported";
public final String NOT_SUPPORT = "None";

if (getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH)) {
            aDisplayInfo.multiTouch = SUPPORT;
        } else {
            aDisplayInfo.multiTouch = NOT_SUPPORT;
        }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!