关闭android studio中打开的选项卡的快捷方式是什么?
我是android工作室的新手.我尝试用CTRL+ W.它不起作用.我搜索了一会儿.但我还没有得到它.任何人请提供关闭打开的选项卡的快捷方式.
我试图在选项卡内的两个活动之间传递数据.我正在尝试使用sendBroadcast().设置断点我永远不会到达onReceive().
表现:
<activity
android:name=".WebResults"
android:label="@string/app_name">
<intent-filter>
<action android:name="com.toxy.LOAD_URL" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
活动发件人:
Intent intent=new Intent(getApplicationContext(),WebResults.class);
intent.setAction("com.toxy.LOAD_URL");
intent.putExtra("url",uri.toString());
sendBroadcast(intent);
Run Code Online (Sandbox Code Playgroud)
活动接收者:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
IntentFilter filter = new IntentFilter("com.toxy.LOAD_URL");
this.registerReceiver(new Receiver(), filter);
}
private class Receiver extends BroadcastReceiver {
@Override
public void onReceive(Context arg0, Intent arg1) {
String url = arg1.getExtras().getString("url");
WebView webview =(WebView)findViewById(R.id.webView);
webview.loadUrl(url);
}
}
Run Code Online (Sandbox Code Playgroud) 我想只使用本机Python库将JSON编码数据发送到服务器.我喜欢请求,但我根本无法使用它,因为我不能在运行脚本的机器上使用它.我需要在没有的情况下这样做.
newConditions = {"con1":40, "con2":20, "con3":99, "con4":40, "password":"1234"}
params = urllib.parse.urlencode(newConditions)
params = params.encode('utf-8')
req = urllib.request.Request(conditionsSetURL, data=params)
urllib.request.urlopen(req)
Run Code Online (Sandbox Code Playgroud)
我的服务器是本地Wamp服务器.我总是得到一个
urllib.error.HTTPError:HTTP错误500:内部服务器错误
我100%确定这不是服务器问题,因为同一台机器上具有相同网址的相同数据与同一服务器一起使用请求库.(也适用于发送POST请求的程序).我无法找出它为什么这样做......我自己编写了API.
我想改变主视图(不是按钮或文本视图)的背景颜色,只是通常是黑色的真实背景...我得到了这段代码:
view.setBackgroundColor(0xfff00000);
Run Code Online (Sandbox Code Playgroud)
这是在里面OnClickListener,但它只是改变了Button的背景.
我有一个appsettings.json看起来像这样的文件:
{
"MyConfig": {
"ConfigA": "value",
"ConfigB": "value"
}
}
Run Code Online (Sandbox Code Playgroud)
在我的Startup.cs建设中IConfiguration:
public ConfigurationRoot Configuration { get; set; }
public Startup(ILoggerFactory loggerFactory, IHostingEnvironment environment)
{
var builder = new ConfigurationBuilder()
.SetBasePath(environment.ContentRootPath)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddEnvironmentVariables();
Configuration = builder.Build();
}
public void ConfigureServices(IServiceCollection services)
{
//GetSection returns null...
services.Configure<MyConfig>(Configuration.GetSection("MyConfig"));
}
Run Code Online (Sandbox Code Playgroud)
但Configuration.GetSection("MyConfig")总是返回null,尽管我的JSON文件中存在该值.Configuration.GetSection("MyConfig:ConfigA")工作得很好.
我究竟做错了什么?
我正在使用Version 68.0.3440.106 (Official Build) (64-bit)Chrome macOS Sierra 10.12.6。
我有以下代码:
\n\n<div class="emoji">\xe2\x98\xba\xef\xb8\x8f</div>
它只发生在这个特定的表情符号上。其他人都工作正常。为什么?
\n我有一些ConfigureServices运行迁移时失败的代码:
dotnet ef migrations list
Run Code Online (Sandbox Code Playgroud)
我正在尝试添加证书,但找不到文件(在整体启动项目时可以使用)。有没有办法做这样的事情:
if (!CurrentEnvironment.IsMigration()) {
doMyStuffThatFailsInMigration()
}
Run Code Online (Sandbox Code Playgroud)
这样,我可以保留我的代码,但是在不运行迁移时仅执行它即可。
谢谢
我的 Angular 项目中有以下路由配置:
export const routes: Routes = [
{ path: 'a/:id', loadChildren: './a/a.module#AModule', data: {a: a}},
{ path: 'b/:id', loadChildren: './b/b.module#BModule', data: {a: b}}
];
Run Code Online (Sandbox Code Playgroud)
现在我可以像这样获取路由配置:
this.router.config //outputs the above array
Run Code Online (Sandbox Code Playgroud)
显示,但由于配置具有未解析的路径并且路由器保存已解析的路径,因此this.router.url我a如何正确识别正确的路径。Route
我想要这样做的原因是访问my所在data的位置,而不是组件本身(角度文档说该对象只能由路由组件本身访问。app.componentrouter-outletdata
我的Android Studio项目有问题,编译得很好,我不知道我做了什么打破它.
错误:任务':app:dexDebug'的执行失败.com.android.ide.common.internal.LoggedErrorException:无法运行命令:C:\ Users\Moritz\AppData\Local\Android\sdk\build-tools\21.1.1\dx.bat --dex --no- optimize --output C:\ Users\Moritz\AndroidStudioProjects\Expenses1\app\build\intermediates\dex\debug --input-list = C:\ Users\Moritz\AndroidStudioProjects\Expenses1\app\build\intermediates\tmp\dex\debug\inputList.txt错误代码:1
build.gradle(module:app)
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v4:22.0.0'
compile ('com.larswerkman:HoloColorPicker:1.4')
compile ('com.melnykov:floatingactionbutton:1.1.0')
compile 'net.sf.opencsv:opencsv:2.3'
compile 'com.itextpdf:itextpdf:5.0.6'
compile 'joda-time:joda-time:2.7'
compile 'com.github.m1s73r:LolliPin:v1.3'
compile 'com.github.PhilJay:MPAndroidChart:v2.0.9'
compile 'net.objecthunter:exp4j:0.4.5'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
Run Code Online (Sandbox Code Playgroud) 当前,用户只能使用“材料” create和“ done图标”作为步骤标题。这些更改提供了通过提供ng-template覆盖来自定义图标的功能。所以我找到了更新,
但是当我将其用作
<mat-horizontal-stepper [linear]="isLinear">
<mat-step [stepControl]="firstFormGroup">
<form [formGroup]="firstFormGroup">
<ng-template matStepLabel>Fill out your name</ng-template>
<ng-template matStepperIcon="edit">
<custom-icon>edit</custom-icon>
</ng-template>
<mat-form-field>
<input matInput placeholder="Last name, First name" formControlName="firstCtrl" required>
</mat-form-field>
<div>
<button mat-button matStepperNext>Next</button>
</div>
</form>
</mat-step>
<mat-step>
<ng-template matStepLabel>Done</ng-template>
You are now done.
<div>
<button mat-button matStepperPrevious>Back</button>
</div>
</mat-step>
</mat-horizontal-stepper>
Run Code Online (Sandbox Code Playgroud)
我得到这个错误
Uncaught Error: Template parse errors:
'custom-icon' is not a known element:
1. If 'custom-icon' is an Angular component, then verify that it is part …Run Code Online (Sandbox Code Playgroud)