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

前端 未结 4 2124
盖世英雄少女心
盖世英雄少女心 2021-01-04 04:19

How can I verify, that device support multitouch event? If device have resistent display, multitouch is not possible. Is that way to find out, what kind of display is in dev

相关标签:
4条回答
  • 2021-01-04 04:39

    You can use PackageManager.hasSystemFeature with PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH

    There is an interesting series of articles on Android multi-touch that are worth a look

    Hope this helps,

    Phil Lello

    0 讨论(0)
  • 2021-01-04 04:39
    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;
            }
    
    0 讨论(0)
  • 2021-01-04 04:58

    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.

    0 讨论(0)
  • 2021-01-04 05:00

    A quick example:

    boolean multi = 
    getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);
    
    0 讨论(0)
提交回复
热议问题