开发者

Is it possible to detect if an Android phone has a trackball?

开发者 https://www.devze.com 2023-01-15 12:58 出处:网络
My application requires users to hold down the trackball in order to access an a开发者_开发百科dvanced menu.Not all phones have a trackball, however, so I need to remove this requirement for such phon

My application requires users to hold down the trackball in order to access an a开发者_开发百科dvanced menu. Not all phones have a trackball, however, so I need to remove this requirement for such phones. Is there a way to detect if the phone has a trackball?


Use the Configuration object, specifically the navigation and navigationHidden fields. You can get a Configuration object via getResources().getConfiguration().

0

精彩评论

暂无评论...
验证码 换一张
取 消