带checkBox的listView会出现这样的问题:当我们选中listview中的某个条目时,拖动listView,当将选中的条目移出时,选中的信息就丢失了,同时,刚移进来的条目的状态为选中。为什么会出现这样的问题呢?这是由于仅通过控件自身来记录选中状态,而没有把选中状态记录到对象中去。所以某个条目一移出,选中的信息就丢失了。同时,移进来的条目复用了刚移出的条目,所以它会被选中。解决的办法是,通过对象bean记住状态。关键代码如下:
1、处理选中条目的回调函数。一旦选中,就把状态记录到内存数据库list中,而不是仅靠控件自身记住。
lv_task_manager.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// 判断这个条目是否是出于选中状态.
Object obj = lv_task_manager.getItemAtPosition(position);
if (obj != null && obj instanceof TaskInfo) {
CheckBox cb = (CheckBox) view
.findViewById(R.id.cb_task_checked);
TaskInfo taskinfo = (TaskInfo) obj;
if (taskinfo.isChecked()) {
taskinfo.setChecked(false);
cb.setChecked(false);
} else {
taskinfo.setChecked(true);
cb.setChecked(true);
}
}
}
});
2、提供选中状态的对象
//这是提供给setOnItemClickListener方法使用的。
public Object getItem(int position) {
if (position == 0) {
return null;
} else if (position <= usertaskinfos.size()) {
return usertaskinfos.get(position - 1);
} else if (position == usertaskinfos.size() + 1) {
return null;
} else {
return systemtaskinfos.get(position - 1 - usertaskinfos.size()
- 1);
}
}
3、设置view控件的值,重点看checkbox
ViewHolder holder;
if (convertView != null
&& convertView instanceof RelativeLayout) {
view = convertView;
holder = (ViewHolder) view.getTag();
} else {
holder = new ViewHolder();
view = View.inflate(getApplicationContext(),
R.layout.task_item, null);
holder.iv_icon = (ImageView) view
.findViewById(R.id.iv_task_item_icon);
holder.tv_mem = (TextView) view
.findViewById(R.id.tv_task_item_mem);
holder.tv_name = (TextView) view
.findViewById(R.id.tv_task_item_name);
holder.cb = (CheckBox) view
.findViewById(R.id.cb_task_checked);
view.setTag(holder);
}
TaskInfo taskinfo = usertaskinfos.get(position - 1);
holder.iv_icon.setImageDrawable(taskinfo.getIcon());
holder.tv_mem.setText(Formatter.formatFileSize(
getApplicationContext(), taskinfo.getMemsize()));
holder.tv_name.setText(taskinfo.getName());
//如果是一个新的位置(以前没有出来过)时,就会默认赋值为false(成员变量默认赋初值)
//如果是之前出来过的位置,由于之前把 position位置的选中结果存在了taskinfo中,这次可以找回来。
holder.cb.setChecked(taskinfo.isChecked());
2012-10月26号,win8发布了。话说ARM厂商只有TI,高通,NVIDIA三家获得MS的合作。且NVDIA据说2月份就出了ARM架构的Win8平板电脑,因此看看NVIDIA的双核芯片和三星的有啥优势?对比如下,不知他们价格如何。三星4212的已经有开发板在卖了。不过不是win8的系统。呵呵。
Tegra 3 Specifications:
CPU Quad-Core, with 5th battery-saver core Max Frequency Up to 1.7 GHz Single Core /1.6 GHz Quad-Core L2 Cache 1 MB L1 Cache (I/D) (32KB / 32KB) per core Memory Frequency DDR3-L 1500 LPDDR2-1066 Memory Size Up to 2 GB GPU Architecture ULP GeForce 3D Performance Relative to Tegra 2* Up to 3x Cores 12 3D Stereo Yes Full Programmability Yes OpenGL ES Version 2 OpenVG 1.1 EGL 1.4 Video (1080p) Decode H.264 (HP @ 40Mbps) VC-1 AP MPEG2 MPEG-4 DivX 4/5 XviD HT H.263 Theora VP8 WMV Sorenson Spark Real Video VP6 Encode H.264 MPEG4 H.263 VP8 Video Teleconference (VTC) H.264 MPEG4 H.263 VP8 Audio Decode AAC-LC AAC+ eAAC+ MP3 MP3 VBR WAV/PCM AMR-NB AMR-WB BSAC MPEG-2 Audio Vorbis WMA 9 WMA Lossless WMA Pro G.729a * G.711 * QCELP * EVRC * * Through third party Encode AAC LC AAC+ eAAC+ PCM/WAV AMR-NB AMR-WB Imaging Primary Camera 32 MP Secondary Camera 5 MP Mpixel/s 300 Digital Zoom Up to 16x JPEG Decoding/Encoding 80MP/sec Still Image Stabilitization Yes Video Stabilization Yes Features Auto Exposure Auto White Balance Auto Focus Lens Shading 9th order De-Mosaic Sharpening Programmable De-Noise MIPI CSI Yes Display Display Controllers 2 simultaneous HDMI (1920x1080) LCD 2048x1536 CRT 1920x1200 MIPI DSI Yes Package Package 14x14 BGA 24.5x24.5 BGA Process 40 nm三星芯片:
Features of Exynos 4212
The features of Exynos 4212 are:
ARM Cortex-A9 based Quad CPU Subsystem with NEON
32/32 KB I/D Cache, 1 MB L2 Cache
Operating frequency up to 800 MHz at 0.9 V, 1 GHz at 1.0 V, and 1.5 GHz at TBD V
128-bit/64-bit Multi-layer bus architecture
Core-D domain for ARM Cortex-A9 Quadl, CoreSight, and external memory interface
Operating frequency up to 200 MHz at 1.0 V
Global D- domain mainly for multimedia components and external storage interfaces
Operating frequency up to 100 MHz at 1.0 V
Core-P, Global-P domain mainly for other system component, such as system peripherals, peripheral DMAs, connectivity IPs and Audio interfaces.
Operating frequency up to 100 MHz at 1.0 V
Audio domain for low power audio play
Advanced power management for mobile applications
64 KB ROM for secure booting and 256 KB RAM for security function
8-bit ITU 601/656 Camera Interface supports horizontal size up to 4224 pixels for scaled and 8192 pixels for un-scaled resolution
Multi Format Codec provides encoding and decoding of MPEG-4/H.263/H.264 up to 1080p@30 fps and decoding of MPEG-2/VC1/Xvid video up to 1080p@30fps
Image Signal Processing subsystem
JPEG encoder supports various format.
3D Graphics Acceleration with scalable Multicore GPU.
2D Graphics Acceleration support.
1/2/4/ 8bpp Palletized or 8/16/24bpp Non-Palletized Color TFT recommend up to SXGA resolution
HDMI interface support for NTSC and PAL mode with image enhancer
MIPI-DSI and MIPI-CSI interface support
One AC-97 audio codec interface and 3-channel PCM serial audio interface
Three 24-bit I2S interface support
One TX only S/PDIF interface support for digital audio
Eight I2C interface support
Three SPI support
Four UART supports three Mbps ports for Bluetooth 2.0
On-chip USB 2.0 Device supports high-speed (480 Mbps, on-chip transceiver)
On-chip USB 2.0 Host support
Two on-chip USB HSIC
Four SD/ SDIO/ HS-MMC interface support samsung / david.pang at 09:44,2011.12.06
SAMSUNG
Samsung Confidential
Exynos 4212_UM 1 Product Overview
1-4
Preliminary product information describes products that are in development, for which full characterization data and
associated errata are not yet available. Specifications and information herein are subject to change without notice.
32-channel DMA controller (16 channels for Memory-to-memory DMA, 16 channels for Peripheral DMA)
Supports 14 8 key matrix
Configurable GPIOs
Real time clock, PLL, timer with PWM, and watch dog timer
Multi-core timer support for accurate tick time in power down mode (except sleep mode)
Memory Subsystem
Asynchronous SRAM/ ROM/ NOR interface with x8 or x16 data bus
NAND interface with x8 data bus
LPDDR2 interface (800 Mbps/pin DDR)
Embedded GPS/AGPS/GLONASS.
功能:
A)5种以上的用户主题(theme)
B)条码扫描
C)室内定位,室外GPS定位
D)地图显示
E)签到,签退(上传GPS信息和时间到服务器上)
F)连续GPS信息上传
G)服务器上跟踪用户行走路线,查看签到签退时间,地点
OTA应用下载 :BlackBerry手机访问这里 支持手机:BlackBerry 9900/9930/9850
技术:
HTML 5框架:JQuery Mobile;小部分Java代码做连续GPS定位和UDP服务器数据访问;应用打包:BlackBerry WebWorks
截图:
应用图标
启动界面
登录界面
正在登录
人员定位服务器走UDP端口,因此需要设置手机的APN(移动cmnet;联通3gnet;电信不需要设置APN)
主界面
室内采用浏览器定位(基站和WiFi定位)
定位后显示Google地图,可缩放。中间红点的标准就是你的位置
点击左上角的“签到”按钮到服务器上进行签到
签到后,签到按钮变成签退按钮
如果GPS数据过期,提示你需要点击右侧的刷新按钮重新定位后才能签到。
下面看看界面主题设置。
这里采用JQuery Mobile的主题设置,可以有7,8主题,并且开发者可以开发自己新的主题。
选择了主题后,提示需要重新启动程序,主题才能生效。
黄色主题
黑色主题
浅灰色主题
缺省的蓝色主题
另外一个淡灰色主题
条码扫描:支持各种条码和二维码
点击菜单,屏幕的样例条码,都可以开始进行扫描
扫描一本书的条码
扫描后结果在界面中显示出来
服务器端签到信息,可作为考勤记录
服务器端人员实时定位跟踪,历史轨迹回放
服务器端历史定位数据记录,可作为考勤记录