[英]How to find out which layout is using in running apk in android?
I have my apk in eclipse and run it on device. 我的apk中有我的apk,并在设备上运行它。 In my apk is a lot of layouts (sw240, sw300, sw340 sw360, etc) and on layout which is loaded is a bug.
在我的apk中有很多布局(sw240,sw300,sw340 sw360等),并且在加载的布局上是一个错误。 But I known nothing about device so I want to know from eclipse (or some another way) which layout is using now on device (when I start my apk from eclipse on device).
但是我对设备一无所知,所以我想从eclipse(或其他方式)知道设备上正在使用哪种布局(当我从设备上的eclipse启动apk时)。
Is a way? 不在?
i ussually use this code below to know which layout i run if i have many layout design size: 如果我有很多布局设计尺寸,我通常使用下面的代码来知道运行哪个布局:
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE))
.getDefaultDisplay();
int orientation = display.getOrientation();
// use this to see on your console
System.out.println("Screen Size: " + orientation);
// use this to see on logcat
Log.v(TAG, "Screen Size:" + orientation);
from that i think you can know which layout size that load when you execute the application. 由此我认为您可以知道执行应用程序时加载的布局大小。
I found something like that: 我发现了这样的东西:
DisplayMetrics m = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(m);
Log.d(TAG, "@@@@@@ " + m);
but it is not exactly what I wanted. 但这不是我想要的。 But I'm closer.
但是我离我更近了。
So how recalculate result like this 那么如何重新计算这样的结果
DisplayMetrics{density=0.75, width=320, height=240, scaledDensity=0.75, xdpi=132.52174, ydpi=133.2459}
on swXXXX? 在swXXXX上?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.