【问题标题】:how to insert screen coordinate into hashmap android如何将屏幕坐标插入hashmap android 【发布时间】:2012-05-20 15:42:27 【问题描述】: 我想在 hashmap 数据结构中插入屏幕坐标意味着在 hashmap 中插入 setX(x) 和 setY(y) 值。我在这个应用程序中制作了一个android应用程序需要存储屏幕坐标。 【问题讨论】: 标签: android android-layout 【解决方案1】: 获取大小.. Display display = getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); int width = size.x; int height = size.y; 您可以参考here 对于哈希映射 HashMap<Integer> meMap=new HashMap<Integer>(); meMap.put(width); meMap.put(height); Given 只是一个例子。你可以做相应的事情。其他Reference. 【讨论】: hee @Lucifer 我已经接受了这个并在我的应用程序中实现了这个