`

Parameter specified as non-null is null for data in onActivityResult

阅读更多

最近使用kotlin结合zxing开发,发现有些问题:

如果返回一个null值,在onActivityResult里面会报Parameter specified as non-null is null for data的错误。这个问题在java里并不会出现。原因在于kotlin有非空检查。如果直接使用onActivityResult的java源码转成kotlin的话,会发现

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {}

 data:Intent那里少了一个问号,只要加上?就可以了。

分享到:
评论

相关推荐

    acpi控制笔记本风扇转速

    produced when this parameter was a null string (""). Now, the original input filename is used as the AML output filename, with an ".aml" extension. Implemented a generic batch command mode for the ...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    - improved split mechanism (added TfrxStretcheable.HasNextDataPart for complicated data like RTF tables) - improved crosstab speed when using repeat band with crosstab object version 4.9 ------------...

    BURNINTEST--硬件检测工具

    number of Network Addresses specified in Preferences->Network will be the number of NICs tested. This will error faulty NICs that are not detected by the BurnInTest auto NIC detection mechanism. ...

    The user specified as a definer ('root'@'%') does not exist 解决方法

    mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法

    butterknife 8.8.0

    When specified as false, checks for required views being non-null are elided and casts are no longer guarded with user-friendly error messages. This reduces the amount of generated code for release ...

    应用Dephi 开发佳能照相机API

    In: inRef - The reference for the object item. Out: None Returns: Returns a reference counter if successful. For errors, returns $FFFFFFFF. -----------------------------------------------------...

    win 3.11 for workgroup tcpip支持

    more than one default gateway is specified for a given IP network or for multiple IP networks on different network cards, the first default gateway for the first network card is always used to route ...

    ramin 2.2 for xp

    It is optimized for low-bandwidth connections such as modems. Connecting via modem, screen refreshment rate reaches 5-10 updates per second. If connected to a LAN you can work on remote computer ...

    SSD7 选择题。Multiple-Choice

    The foreign key in a table T1 _____ the same _____ as the corresponding primary key in table T2. must have, name need not have, name must have, domain (a) I, II, and III (b) I and II (c) ...

    数位板压力测试

    The device must define an absolute or relative coordi-nate space in at least two dimensions for which it can return position data. The device must have a point-ing ap¬para¬tus or method (such as a ...

    NX二次开发UF-DRF-set-specified-sbf-file 函数介绍

    NX二次开发UF_DRF_set_specified_sbf_file 函数介绍,Ufun提供了一系列丰富的 API 函数,可以帮助用户实现自动化、定制化和扩展 NX 软件的功能。无论您是从事机械设计、制造、模具设计、逆向工程、CAE 分析等领域的...

    On Multihop Communications For In-Vehicle Internet Access Based

    A vehicular ad hoc network (VANET) is an emerging technology which has a great potential in realizing a variety of new applications. This paper presents a new packet routing scheme which allows a ...

    struts_2.3.12GA_API文档(chm版本)

    Gets a message based on a key using the supplied args, as defined in MessageFormat, or null if no message is found. String getText(String aTextName, String defaultValue) Gets a message based on a...

    ApiHooks for Win32

    ApiHooks allows to hook any API in specified process. ----------------------------------------------------- ApiHooks allows inserting module (with hooks) into the specified process. ApiHooks exports ...

    wodTelnetDLX.exe

    Supports Telnet, SSH1, SSH2, ...Fires events when data is received, or key (even special) is pressed Allows transparent use of any of supported protocol. Change one property - leave other code the same!

    MyDAC7.6.11

    TMyDumpOptions.FieldsAsString property for dumping all data types as string is added Bug with using quoted field names in the IndexFieldNames property is fixed Bug in TMyStoredProc with closing ...

    解决Mysql Error-The user specified as a definer (‘mysql.infoschema’

    在MySQL数据库操作中,"The user specified as a definer (‘mysql.infoschema’@’localhost’) does not exist" 是一个常见的错误提示,这通常发生在尝试执行存储过程、触发器或者视图等对象时,这些对象的定义者...

    Bochs - The cross platform IA-32 (x86) emulator

    - re-implemented "options" parameter for additional options of connected devices (currently only used to set the speed reported by device and to specify an alternative redolog file of USB MSD disk ...

Global site tag (gtag.js) - Google Analytics