我有一个按钮,当我点击它时,我想调用Youtube应用程序并搜索预定义的字符串(搜索字符串是常量,我的意思是Youtube应用程序将自动显示结果).我知道,为了搜索频道,我们放了
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.youtube.com/user/channel"))
Run Code Online (Sandbox Code Playgroud)
但是搜索特定视频(常量字符串)呢?谢谢您的帮助.
我正在使用AFNetworking尝试上传文件:
-(void)uploadFile{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"data.sqlite"];
NSURL *filePathURL = [NSURL fileURLWithPath:filePath];
NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://localhost:8888/myApp/upload.php" parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formData appendPartWithFileURL:filePathURL name:@"file" fileName:@"data.sqlite" mimeType:@"text/html" error:nil];
} error:nil];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
NSProgress *progress = nil;
NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithStreamedRequest:request progress:&progress completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
if (error) {
NSLog(@"Error: %@", error);
} else {
NSLog(@"Success: %@ %@", response, responseObject); …Run Code Online (Sandbox Code Playgroud) 我只是想知道如何擦除android模拟器中的虚拟SD卡.
我Error parsing XML: unbound prefix在这个xml文件中有一个:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sipLabel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<ImageView android:src="@drawable/connected" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="0.35" android:gravity="center"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
错误在于<ImageView>.可能是什么问题呢?
非常感谢你.
我有一个存储在Wamp服务器中的PHP脚本,并希望我的应用程序执行它来从服务器执行一些图像处理,然后服务器将结果发送到Android手机.这有可能吗?如果是这样,你能提供一些提示吗?
非常感谢你.
我已经为我的mat-table. 但是,表格及其内容不遵守设置的高度。我想向这个表添加一个垂直滚动。

<div style="height: 200px;">
<mat-table>table content</mat-table>
</div>
Run Code Online (Sandbox Code Playgroud) 我正在构建一个必须在一段时间后显示通知的应用程序,因为我使用了AlarmManager.要每15分钟发出一次通知,我们必须这样做:
mgr.setRepeating(AlarmManager.RTC_WAKEUP, SystemClock.elapsedRealtime(), 900000, pi);
Run Code Online (Sandbox Code Playgroud)
有一天我们86400000有价值.我的想法是每周也发出一个通知(乘以86400000与7)和每个月(乘以86400000与28).问题是月份不变,我有:
The literal 2419200000 of type int is out of range
Run Code Online (Sandbox Code Playgroud)
使用AlarmManager进行长时间通知是不可能的?有解决方案吗?谢谢.编辑:
if (Integer.valueOf(choix_notif) == 0)
{
mgr.setRepeating(AlarmManager.RTC_WAKEUP, SystemClock.elapsedRealtime(), 86400000, pi);
Log.d("DAY_REPEATING","OK");
}
else if (Integer.valueOf(choix_notif) == 1) {
mgr.setRepeating(AlarmManager.RTC_WAKEUP, SystemClock.elapsedRealtime(), 604800000, pi);
Log.d("WEEK_REPEATING","OK");
}
else if (Integer.valueOf(choix_notif) == 2) {
mgr.setRepeating(AlarmManager.RTC_WAKEUP, SystemClock.elapsedRealtime(), 2419200000L, pi);
Log.d("MONTH_REPEATING","OK");
Run Code Online (Sandbox Code Playgroud) 是否可以更加"自动"在地图中添加地理位置?我的意思是,如果我们要在地图中添加许多点(超过100个),我们就不必逐个添加它们:
GeoPoint point2 = new GeoPoint(microdegrees(36.86774),microdegrees(10.305302));
GeoPoint point3 = new GeoPoint(microdegrees(36.87154),microdegrees(10.341815));
GeoPoint point4 = new GeoPoint(microdegrees(36.876093),microdegrees(10.325716));
pinOverlay.addPoint(point2);
pinOverlay.addPoint(point3);
pinOverlay.addPoint(point4);
Run Code Online (Sandbox Code Playgroud)
有没有一种方法可以将它们全部存储在一个表中,然后编译器逐个添加它们?
我UIImageView用UILabel它创建了一个子视图:
UIImageView *img=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, [[UIScreen mainScreen] bounds].size.height)];
img.backgroundColor=self.view.backgroundColor;
UILabel *textOne=[[UILabel alloc]initWithFrame:CGRectMake(10, 10, 290, 250)];
textOne.text=_textOneLabel.text;
textOne.textColor=_textOneLabel.textColor;
UILabel *textTwo = [[UILabel alloc] initWithFrame:CGRectMake(100,180,200,100)];
textTwo.text=_textTwoLabel.text;
textTwo.textColor=_textTwoLabel.textColor;
[img addSubview:textOne];
[img addSubview:textTwo];
UIImageWriteToSavedPhotosAlbum(img.image, nil, nil, nil); //img.image is null
Run Code Online (Sandbox Code Playgroud)
我想创建一个UIImage将其保存在相机胶卷中,UIImageView并创建和2 UILabel.img.image返回null,因为没有分配给的图像UIImageView.
你知道如何实现这个目标吗?
我有一个Prestashop模块,我想在单击按钮时执行一个钩子(插入产品)。这是我现在正在做的事情:
在module.php文件中,我正在使用此功能:
public function hookActionProductAdd()
{
//code to create a product
}
Run Code Online (Sandbox Code Playgroud)
在module.tpl文件中,我正在创建一个按钮,其onClick执行钩子:
<button onclick="createProduct()">Create product</button>
Run Code Online (Sandbox Code Playgroud)
然后在tpl文件的末尾添加脚本代码:
<script>
function createProduct() {
{hook h='ActionProductAdd'}
}
</script>
Run Code Online (Sandbox Code Playgroud)
问题是该挂钩在每次页面访问/重新加载时都会执行,我希望它仅在单击按钮时才执行。
是否可以返回NSMutableArray 的值(而不是计数)部分中的行数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSLog(@"number of rows in section: %@",[arrayofNombre objectAtIndex:section]);//it prints the right value
return [arrayofNombre objectAtIndex:section];
}
Run Code Online (Sandbox Code Playgroud)
应用程序崩溃,当我输入一个常量值(例如返回2)时,应用程序运行但它没有给出预期的结果.我肯定错过了一些东西.谢谢你的帮忙.
我有一个方法,使UILocalNotification存储:
- (void)save:(NSString *)program at:(NSDate*)date {
NSLog(@"date to save: %@", date);
// NSLog(@"timezone: %@",[date descriptionWithLocale:[NSLocale systemLocale]]);
UILocalNotification* localNotification = [[UILocalNotification alloc] init];
NSLog(@"date to fire: %@", date);
localNotification.fireDate = date;
NSString *s=[program stringByAppendingString:@" is now on "];
NSString *title=[s stringByAppendingString:channel];
localNotification.alertBody = title;
localNotification.alertAction = @"Show...";
//localNotification.timeZone = [NSTimeZone localTimeZone];
localNotification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber] + 1;
NSLog(@"notification to save %@",localNotification);
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
// Request to reload table view data
[[NSNotificationCenter defaultCenter] postNotificationName:@"reloadData" object:self];
// Dismiss the view controller …Run Code Online (Sandbox Code Playgroud) 我有这个变量:
protected ArrayList<String> list = new ArrayList<String>();
Run Code Online (Sandbox Code Playgroud)
数据采用以下形式:
data = date + ": " + y + "L/100KM "+ " " + value1 + "dt "+ value2 + "KM\n";
Run Code Online (Sandbox Code Playgroud)
我想从中检索数据value1.我怎样才能做到这一点?
android ×7
ios ×4
php ×2
alarmmanager ×1
android-xml ×1
angular ×1
angular6 ×1
arraylist ×1
google-maps ×1
hook ×1
iphone ×1
prestashop ×1
uiimage ×1
uiimageview ×1
uitableview ×1
wampserver ×1
youtube ×1