2017-04-03 70 views
0

我想在Android Studio中實現一個使用Zbar掃描程序庫(https://github.com/dm77/barcodescanner)的應用程序。 我已經將它導入到我的IDE中,經過一連串的出血嘗試來重組各種版本的庫的兼容性後,我選擇修改使用Zbar庫的現有示例。Android ZBar掃描程序庫怪異行爲

這裏有一個奇怪的行爲:當涉及到一個新的活動(原始示例中不存在一個活動)時,該應用程序崩潰,沒有錯誤或異常。

我坐了我的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 
+0

你可以發佈你的代碼嗎? – Johny

+0

這裏是我的代碼:https://github.com/alessandroargentieri/ZbarExample與原來的代碼相比,我想從SplashActivity.class啓動應用程序,這是我創建的一項新活動。 –

回答

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> 
+0

謝謝,但已經有了意向過濾器,正如你在github代碼中看到的那樣 –