ListActivity中 ListView一般都是对应的响应事件是onListItemClick(ListView l, View v, int position, long id)
当存入的是cursor,那取值的时候如下:
Cursor c=(Cursor)adapter.getItem(position);
然后对应的取值就行了比如,c.getLong(c.getColumnIndex(CallLog.Calls.NUMBER)),获取存取的电话号码
不知道为什么,网上找了很久,才找到,贴出来,让大家共享
http://blog.csdn.net/lrh_079/article/details/5885099
由于项目需要,需在本本上安装TortoiseSVN(简称TSVN)客户端。在TSVN安装到一半时悲情时刻发生了,弹出了一个错误提示框,内容如下:
An error occured during the installation of assembly componet
{167A8BB9-1A64-362B-8E09-4FD8B1F0108E}.
HRESULT:0X800736FD.
排除了系统兼容,软件版本等因素,依然无法找到产生该问题的原因。最后还是求助强大的google才得以解决。
产生问题的原因:
之前有安装过比较大型的软件,如ArcGIS等,导致注册表允许的空间都已写满,无法再安装软件。
解决方法如下:
修改注册表项,去除注册表大小限制,把RegistrySizeLimit的值修改为ffffffff即可:
HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control
项: RegistrySizeLimit
类型: REG_DWORD
值: 0xffffff (4294967295)
- (IBAction)URLFetchWithProgress:(id)sender
{
[startButton setTitle:@"Stop" forState:UIControlStateNormal];
[startButton addTarget:self action:@selector(stopURLFetchWithProgress:)forControlEvents:UIControlEventTouchUpInside];
NSString*tempFile = [[[[NSBundle mainBundle] bundlePath]stringByDeletingLastPathComponent]stringByAppendingPathComponent:@"MemexTrails_1.0b1.zip.download"];
if ([[NSFileManager defaultManager] fileExistsAtPath:tempFile]) {
[[NSFileManager defaultManager] removeItemAtPath:tempFile error:nil];
}
[self resumeURLFetchWithProgress:self];
}
- (IBAction)stopURLFetchWithProgress:(id)sender
{
networkQueue = [[ASINetworkQueue alloc] init];
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:selfselector:@selector(updateBandwidthUsageIndicator) userInfo:nil repeats:YES];
timer = nil;
[startButton setTitle:@"Stop" forState:UIControlStateNormal];
[startButton addTarget:self action:@selector(URLFetchWithProgress:)forControlEvents:UIControlEventTouchUpInside];
[networkQueue cancelAllOperations];
[resumeButton setEnabled:YES];
}
- (IBAction)resumeURLFetchWithProgress:(id)sender
{
[resumeButton setEnabled:NO];
[startButton setTitle:@"Start" forState:UIControlStateNormal];
[startButton addTarget:self action:@selector(stopURLFetchWithProgress:)forControlEvents:UIControlEventTouchUpInside];
[networkQueue cancelAllOperations];
[networkQueue setShowAccurateProgress:YES];
[networkQueue setDownloadProgressDelegate:progressIndicator];
[networkQueue setDelegate:self];
[networkQueue setRequestDidFinishSelector:@selector(URLFetchWithProgressComplete:)];
ASIHTTPRequest*request=[[[ASIHTTPRequest alloc] initWithURL:[NSURLURLWithString:@"http://9991.net/blog/mp3/2.mp3"]] autorelease];
[request setDownloadDestinationPath:[[[[NSBundle mainBundle] bundlePath]
stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"MemexTrails_1.0b1.mp3"]];
[request setTemporaryFileDownloadPath:[[[[NSBundle mainBundle] bundlePath]stringByDeletingLastPathComponent]stringByAppendingPathComponent:@"MemexTrails_1.0b1.zip.down"]];
[request setAllowResumeForFileDownloads:YES];
[networkQueue addOperation:request];
[networkQueue go];
}
- (void)URLFetchWithProgressComplete:(ASIHTTPRequest *)request
{
if ([request error]) {
fileLocation.text=[NSString stringWithFormat:@"An error occurred:%@",[[[requesterror] userInfo] objectForKey:@"Title"]];
} else {
fileLocation.text=[NSString stringWithFormat:@"File downloaded to %@",[requestdownloadDestinationPath]];
}
[startButton setTitle:@"Start" forState:UIControlStateNormal];
[startButton addTarget:self action:@selector(URLFetchWithProgress:)forControlEvents:UIControlEventTouchUpInside];
}
- (IBAction)throttleBandwidth:(id)sender
{
if ([(UIButton *)sender state] ==YES) {
[ASIHTTPRequest setMaxBandwidthPerSecond:ASIWWANBandwidthThrottleAmount];
} else {
[ASIHTTPRequest setMaxBandwidthPerSecond:];
}
}