【发布时间】:2012-02-23 12:22:27
【问题描述】:
我需要根据 ScreenSize 将不同的数据传递给 webservice 例如:
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE)
{
DeviceType=2;
}
else if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL)
{
DeviceType=1;
}
else if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_SMALL)
{
DeviceType=1;
}
else
{
DeviceType=2;
}
我这样做了,但不幸的是我没有得到正确的值,我将 DeviceType 设为 0, 这只发生在任何事件触发时......因为我需要在我的应用程序启动时很快显示来自网络服务的图像,任何想法!!!
【问题讨论】:
标签: android web-services android-layout android-intent android-emulator