问题
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 device, or if device support multitouch?
Thanks.
回答1:
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.
回答2:
A quick example:
boolean multi =
getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);
回答3:
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
回答4:
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;
}
来源:https://stackoverflow.com/questions/5584977/android-how-can-i-verify-that-device-support-multitouch