Android ZBar扫描程序库奇怪的行为

时间:2017-04-03 14:24:18

标签: android zbar

我正在尝试在Android Studio中实现一个使用Zbar扫描程序库(https://github.com/dm77/barcodescanner)的应用程序。 我已经将它导入到我的IDE中,经过一系列的出血尝试重新组织各种版本库的兼容性后,我选择修改使用Zbar库的现有示例。

出现了奇怪的行为:当涉及到一个新的Activity(原始示例中不存在的那个)时,应用程序崩溃,没有错误或异常。

我为我的IDE日志设置了“无过滤器”,以及我在此应用崩溃时可以看到的日志:

04-03 16:22:42.381 2513-2513/? E/Thermal-daemon: [ap] temp_new :33  temp_old :34
04-03 16:22:42.382 2513-2513/? E/Thermal-daemon: Report temperature: [ap] temp :33  report_threshold:1
04-03 16:22:43.644 3085-3520/? E/InputReader: QEEXO fs_classify_touch NULL, not calling FingerSense
04-03 16:22:43.702 3085-3520/? E/InputReader: QEEXO fs_touch_up NULL, not calling FingerSense
04-03 16:22:43.728 3085-3520/? E/InputReader: QEEXO fs_classify_touch NULL, not calling FingerSense
04-03 16:22:43.730 3085-3085/? E/QosMonitor: query:IPQos is not initial!!
04-03 16:22:43.757 3085-3103/? E/ReportTools: This is not beta user build
04-03 16:22:43.790 2484-2484/? E/lowmemorykiller: Error writing /proc/1360/oom_score_adj; errno=22
04-03 16:22:43.820 3085-3520/? E/InputReader: QEEXO fs_touch_up NULL, not calling FingerSense
04-03 16:22:43.828 3713-4443/? E/HwSystemManager: LeisureTrafficSetting:result is empty
04-03 16:22:43.865 3085-3519/? E/InputDispatcher: channel '8304ce5 me.dm7.barcodescanner.zbar.sample/me.dm7.barcodescanner.zbar.sample.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
04-03 16:22:43.867 3085-3095/? E/HsmCoreServiceImpl: onTransact in code is: 102
04-03 16:22:43.896 583-595/? E/TotemWeather: WidgetUtils getWidgetShowCityInfo return myLocation
04-03 16:22:43.899 4135-4207/? E/HwLauncher: SettingsEx , no such field.
04-03 16:22:43.963 2486-2486/? E/HAL: load: id=gralloc != hmi->id=gralloc
04-03 16:22:44.012 2486-2486/? E/HAL: load: id=gralloc != hmi->id=gralloc
04-03 16:22:44.146 2486-2486/? E/hwcomposer: setGpuBoost:228: Can't open /sys/class/devfreq/gpufreq/max_freq: Permission denied
04-03 16:22:44.494 2486-2486/? E/HAL: load: id=gralloc != hmi->id=gralloc

1 个答案:

答案 0 :(得分:2)

您必须进入AndroidManifest.xml并将SplashActivity.class设置为启动活动,如下所示:

<activity android:name=".SplashActivity"
          android:theme="@style/FullScreenTheme"
          android:screenOrientation="portrait">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

</activity>