logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

Kotlin协变和逆变

如果说编译不报错,那么继续走下去会看到形参d是Man类型的Myclass引用,result变量要求接收一个Man类型实现的Myclass对象,但是实际上实参data的show方法返回了一个Woman对象,由于它是Person的子类,所以data在实现show方法的时候并没有问题,但是result在接收的时候无法将Man强转为Woman类型,这样就会发生类型转换异常。//下面的实现和调用逻辑没有变化

#kotlin#开发语言#android
【npm install】报错 提示Failed at the node-sass@7.0.3 postinstall script 解决办法

【代码】【npm install】报错 提示Failed at the node-sass@7.0.3 postinstall script 解决办法。

文章图片
Build:Download maven-metadata.xml...打包一直卡在这里

一直在这里不动// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {repositories {maven { url 'https://maven.aliyun.com/repository/public'}maven { ur

android switch 使用

常用属性textOn:控件打开时显示的文字textOff:控件关闭时显示的文字thumb:控件开关的图片track:控件开关的轨迹图片typeface:设置字体类型switchMinWidth:开关最小宽度switchPadding:设置开关 与文字的空白距离switchTextAppearance:设置文本的风格checked:设置初始选中状态splitTrack:是否设置一个间隙,让滑块与底部

#android
拍照 android.os.FileUriExposedException: file:///storage/emulated/0/ exposed beyond app throu

拍照代码如下Uri imageUri = null;String fileName = null;Intent openCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);REQUEST_CODE = TAKE_PICTURE;fileName = "image.jpg";imageUri = Uri.fromFile(new Fi

#android
android: EditTextView不自动获取焦点

但是在 scroview 中 , 这些都没有用 , 在这里面还要对 edittext 添加。在网上能找到这个 , 在父控件添加这个。亲自测试了这样才有效。

#android#android studio
Failed to find Platform SDK with path: platforms;android-30

在运行的时候出现 这个错误 , 版本的要求不一样点上 对勾 , 直接 apply 就可以了

#android
编译报错: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler

dependencies {classpath 'com.android.tools.build:gradle:4.2.1'classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"classpath "com.jakewharton:butterknife-gradle-plugin:$butterknife_ver

#android#gradle#kotlin
observeOn (rx.Scheduler) in Observable cannot be applied to (io.reactivex.Scheduler)异常

.observeOn(AndroidSchedulers.mainThread())一直包标题上面的错误 ,原因是你的版本不一致也有可能是其他的地方版本不一致

#rxjava
到底了