0
我创建了一个方法来测试,如果以实时流的链接是主动或不使用下面的代码的iOS。目标C到Android XML响应
NSError * error = nil;
NSString * responseString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.calvaryccm.com/ServiceTimes.asmx/IsServiceTime"] encoding:NSUTF8StringEncoding error:&error];
NSRange range = [responseString rangeOfString : @"true"];
if (range.location != NSNotFound) {
NSLog(@"%@", responseString); \
// Handle active content.
hiddenVideo.hidden = FALSE;
hiddenAudio.hidden = FALSE;
noService.hidden = TRUE;
}
else {
NSLog(@"%@", responseString);
// Inform user that the content is unavailable
hiddenVideo.hidden = TRUE;
hiddenAudio.hidden = TRUE;
noService.hidden = FALSE;
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: @"Live Service"
message: @"There is no service going on at this time"
delegate: nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
HasShownAlert = TRUE; //let the other event know that the alert has already been shown.
}
问题是,我不知道从哪里开始将此转换为Android,我正在寻找一些指导。感谢您的帮助。
从这里开始:http://developer.android.com/,例如代替UIAlertView中,你可能会被使用'android.app.AlertDialog' – Joe
谢谢乔!这确实是有道理的 –