红鱼儿

ChinaCock扫描控件介绍-使用TCCBarcodeScanner引起app闪退

好几个ChinaCock的朋友说遇到扫码时闪退,进一步总结,都是Android 8的机器上才会出现,今天我也遇到。正好有朋友说,按下面这个改配置文件就可以解决:

 

        <!-- 扫描的activity 加进来 -->
        <activity
            android:name="com.zbar.lib.CaptureActivity"
            android:theme="@android:style/Theme.Light.NoTitleBar"
            android:screenOrientation="portrait"
        />
        <!-- 扫描的activity 加进来 完毕 -->

 原来旧版本是这样的:

        <!-- 扫描的activity 加进来 -->
        <activity
            android:name="com.zbar.lib.CaptureActivity"
             android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:launchMode="singleInstance"
            android:configChanges="orientation|keyboardHidden"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <!-- 扫描的activity 加进来 完毕 -->

 测试通过,感谢群友Trigger,开发环境:Delphi 10.3.1

另外,有朋友反应说,使用像册功能,也会闪退,这个问题,按Delphi 10.3.1拍照遇到的问题处理即可。

后记:

android:theme="@android:style/Theme.Light.NoTitleBar"

上面这行,如果写成:

android:theme="@android:style/Theme.Translucent.NoTitleBar"

就是造成android 8.0.0的机器闪退。

 

posted on 2019-07-12 11:35  红鱼儿  阅读(926)  评论(0编辑  收藏  举报