Is there a way to check if the user is using a tablet or a phone? I've got problems with my tilt function and my new tablet (Transformer)
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I think this is the easiest way to be honest. This will check the screen size that's being used:
Best of luck!
To detect whether or not the device is a tablet use the following code:
LARGE and XLARGE Screen Sizes are determined by the manufacturer based on the distance from the eye they are to be used at (thus the idea of a tablet).
More info : http://groups.google.com/group/android-developers/browse_thread/thread/d6323d81f226f93f
This is the method that i use :
Using:
Configuration.SCREENLAYOUT_SIZE_MASK
Configuration.SCREENLAYOUT_SIZE_LARGE
This is the recommended method!
This method is a recommend by Google. I see this code in Google Offical Android App
iosched
Use this method which returns true when the device is a tablet
If you are only targeting API level >= 13 then try
cheers :-)