小编Sur*_*Rao的帖子

Kotlin自定义对话框参数指定为非null

我收到了这个错误:

引起:java.lang.IllegalArgumentException:指定为非null的参数为null:方法kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull,参数savedInstanceState

当我试图在Kotlin中膨胀自定义对话框时,我在对话框中的super.onCreate行上得到了我上面写的错误.

对话框代码是:

class Custom_Dialog_Exit_App(var activity: Activity)// TODO Auto-generated constructor stub
    : Dialog(activity, R.style.full_screen_dialog) {

    override fun onCreate(savedInstanceState: Bundle) {
        super.onCreate(savedInstanceState)
        requestWindowFeature(Window.FEATURE_NO_TITLE)
        setContentView(R.layout.custom_dialog_exit_app)
        activity.window!!.setLayout(WindowManager.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.MATCH_PARENT)

        initView()
    }

    fun initView() {
        initClicks()
    }

    fun initClicks() {


    }


}
Run Code Online (Sandbox Code Playgroud)

并且init是:

val omer = Custom_Dialog_Exit_App(this@MainActivity)
        omer.show()
Run Code Online (Sandbox Code Playgroud)

请帮忙

android kotlin kotlin-android-extensions

13
推荐指数
2
解决办法
4190
查看次数

接收NPM错误:离子3项目中位置20938处的JSON中的意外字符串

不确定错误在哪里.(*是举行私人项目信息的地方,即Facebook应用程序ID和应用程序名称)我已经收到此错误一段时间了,我无法弄清楚,有什么我想念的吗?

{
    "name": "****",
    "version": "0.0.1",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.4.3",
        "@angular/compiler": "4.4.3",
        "@angular/compiler-cli": "4.4.3",
        "@angular/core": "4.4.3",
        "@angular/forms": "4.4.3",
        "@angular/http": "4.4.3",
        "@angular/platform-browser": "4.4.3",
        "@angular/platform-browser-dynamic": "4.4.3",
        "@firebase/webchannel-wrapper": "^0.2.1",
        "@ionic-native/camera": "^4.3.0",
        "@ionic-native/core": "^4.3.1",
        "@ionic-native/facebook": "^4.2.1",
        "@ionic-native/image-picker": "^4.3.1",
        "@ionic-native/splash-screen": "4.3.1",
        "@ionic-native/status-bar": "4.3.1",
        "@ionic/storage": "2.0.1",
        "angularfire2": "^5.0.0-rc.2",
        "cordova-browser": "^4.1.0",
        "cordova-ios": "^4.4.0",
        "cordova-plugin-camera": "^2.4.1",
        "cordova-plugin-compat": "^1.2.0",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-facebook4": "^1.9.1",
        "cordova-plugin-firebase": …
Run Code Online (Sandbox Code Playgroud)

json node.js ionic3

13
推荐指数
1
解决办法
5719
查看次数

离子cordova在PANIC中运行android结果:缺少'x86'CPU的模拟器引擎程序

经过大量搜索后,我运行时无法解决此错误:

ionc cordova run android -ls

OUTPUT:

ANDROID_HOME=/Users/lucianokrebs/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
No target specified and no devices found, deploying to emulator        
No emulator specified, defaulting to Nexus_5_API_P

Waiting for emulator to start...

PANIC: Missing emulator engine program for 'x86' CPU.
Run Code Online (Sandbox Code Playgroud)

而模拟器永远不会启动

另外,当我跑:

$ ${ANDROID_SDK_ROOT}/tools/emulator -avd my-custom-avd

我有: PANIC: Missing emulator engine program for 'x86' CPU.

但是,当我跑:

$ ${ANDROID_SDK_ROOT}/emulator/emulator -avd my-custom-avd

模拟器启动并正常工作

似乎cordova在尝试启动模拟器时设置了错误的路径.有人已经处理过了吗?

ionic info:
    cli packages: (/usr/local/lib/node_modules)
    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) …
Run Code Online (Sandbox Code Playgroud)

android cordova ionic-framework ionic3

13
推荐指数
2
解决办法
9788
查看次数

为什么LinkedList和arraylist在java中扩展AbstractList?

为什么LinkedList与ArrayList扩展AbstractList中的Java?

当我们想要在实现类中指定公共行为时,使用抽象类.

但是所有的方法AbstractList都被ArrayList和被覆盖了LinkedList.

那么扩展这个类有什么用呢?

java collections linked-list list arraylist

12
推荐指数
2
解决办法
9826
查看次数

串联执行一批承诺.完成Promise.all后,转到下一批

我有一个包含promises数组的数组,每个内部数组可以有4k,2k或500个promise.

总共有大约60k的承诺,我也可以用其他值来测试它.

现在我需要执行Promise.all(BigArray[0]).

一旦第一个内部数组完成,我需要执行下一个Promise.all(BigArray[1]),依此类推,依此类推.

如果我尝试执行Promise.all(BigArray)它的抛出:

fatal error call_and_retry_2 allocation failed - process out of memory
Run Code Online (Sandbox Code Playgroud)

我需要按顺序执行每个promises,而不是并行执行它,我认为这就是Node正在做的事情.我不应该使用新的库,但我愿意考虑答案!

编辑:

这是一段代码示例:

function getInfoForEveryInnerArgument(InnerArray) {
    const CPTPromises = _.map(InnerArray, (argument) => getDBInfo(argument));
    return Promise.all(CPTPromises)
        .then((results) => {
            return doSomethingWithResults(results);
        });
}
function mainFunction() {
    BigArray = [[argument1, argument2, argument3, argument4], [argument5, argument6, argument7, argument8], ....];
    //the summ of all arguments is over 60k...
    const promiseArrayCombination = _.map(BigArray, (InnerArray, key) => getInfoForEveryInnerArgument(InnerArray));

    Promise.all(promiseArrayCombination).then((fullResults) => {
        console.log(fullResults);
        return fullResults;
    }) …
Run Code Online (Sandbox Code Playgroud)

javascript batching node.js promise

12
推荐指数
2
解决办法
7971
查看次数

Angular 2:找不到模块:错误:无法解决

我有一个使用Angular-CLI创建的简单应用程序,我想重构并将app.component.ts代码移动到单独的组件文件中并开始出现一个令人讨厌的错误:

找不到模块:错误:无法解析'./sb/sb.component.html'(我的SBComponent).在下面

这就是我所拥有的:

app.module:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';

import { AppComponent } from './app.component';
import { SBComponent  } from './sb/sb.component'

@NgModule({
  declarations: [
    AppComponent, SBComponent  
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)

app.component:

import { Component } from '@angular/core';
import { NgModule,ElementRef, ViewChild, AfterViewInit} from '@angular/core'
import {BrowserModule} from '@angular/platform-browser' …
Run Code Online (Sandbox Code Playgroud)

angular2-template angular2-modules angular

12
推荐指数
3
解决办法
3万
查看次数

visual studio代码"Shell命令:在PATH命令中安装'代码'命令."

在此输入图像描述我刚开始使用Angular.我安装angular/cli并添加了一个项目.现在我想使用visual studio代码.

我打开命令选项板(Ctrl + Shift + P)并键入'shell command'以查找Shell命令:在PATH命令中安装'code'命令.

但是我得到了这个消息

"没有匹配的命令"

请帮我.为什么不存在?

不重复.

Dupe目标是Mac,而这个问题是在Windows上

visual-studio-code

12
推荐指数
3
解决办法
2万
查看次数

如何添加click事件以在typescript中动态添加html元素

我正在以角度2构建应用程序.我想在动态添加的html元素中添加click事件.我定义了一个字符串(contentString),在这个字符串中我定义了html元素.

var contentString = '<b>' + this.mName + '</b><br/> ' + this.mObject.category + '<br/> Click here for more information <button (click)="navigate()">Navigate here</button>'; 
Run Code Online (Sandbox Code Playgroud)

这个字符串放在一个像这样的html元素中:

var boxText = document.createElement("div");
    boxText.innerHTML = contentString;
Run Code Online (Sandbox Code Playgroud)

虽然当我检查元素时,它已定义了click事件,但它没有触发.

[图片1]

[图片2]

点击它应该控制台日志

navigate() {
console.log("eeeehnnananaa");
}
Run Code Online (Sandbox Code Playgroud)

但这不起作用.谁有解决方案?

html typescript ionic2 angular

11
推荐指数
2
解决办法
2万
查看次数

如何将数据传递给Modal ionic 2

大家好我试图将数据从我的设备视图传递到我的模态(设备详细信息视图)并将其绑定到我的模态,所以如果我这样做(click)=openModal()模态应该打开我点击的参数.但不幸的是,它仍然让任何人知道如何处理它?

//数据源和模态处理程序

import { Component } from '@angular/core';

import { ModalController, Platform, NavParams, ViewController,NavController } from 'ionic-angular';

import { ModalPage } from '../modal/modal';

@Component({
  selector: 'page-deviceslist',
  templateUrl: 'devicelist.html'
})
export class DevicesListPage {

  devices;
  device;
  constructor(
    public  modalCtrl: ModalController,
    public nav: NavController,
    public params: NavParams,
  ) {

    this.devices = [
      {
        title: 'Küche',
        items: [
          {title: 'KüchenAid', consumption:'32 W', checked:'true'},
          {title: 'Thermomix', consumption:'0 W', checked:'false'}
        ]
      },
      {
        title: 'Wohnzimmer',
        items: [
          {title: 'Fernseher',consumption:'0 W', checked:'false'},
          {title: 'Stehlampe',consumption:'60 …
Run Code Online (Sandbox Code Playgroud)

javascript modal-dialog typescript ionic-framework ionic2

11
推荐指数
1
解决办法
2万
查看次数

清除"不可用的迁移"列表(Symfony 3)

有一些迁移已被删除,并留在"不可用的迁移"列表中.如何清除它,因为每次通知消息都会烦恼一点.我的猜测是

migrations:doctrine:version

安慰

php symfony

11
推荐指数
2
解决办法
6400
查看次数