I would like to detect custom screen category in android being used in the particular activity,I would like to detect layout-sw640dp programatically,how can be this achieved.We can do the same for small,normal,large & xlarge layouts but I am not sure on this one,kindly help me on this.Thanks.
相关问题
- 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
Not sure why you need to do that. But, a quick walk-around is to use tag, for example:
In mdpi:
In hdpi:
Then, read tag from your code for R.id.name.
sw640dp
just means the smallest available dimension is at least 640dp. This is based off the available layout space for an activity, not the actual resolution of the device. So you can calculate this based off the dimensions of your root layout in the activity:In the case of the Galaxy S3, it's resolution is 1280x720, which is 640x360 converted to dp units. Since
sw
pertains to the available dimensions of the layout, not the resolution, I'm guessing it would not qualify forsw640dp
since system decorations, such as the status bar, would reduce your layout's available height.