2012-06-25 36 views
0

我已經將ZXing代碼整合到我自己的應用程序中,並且我已經評論了第一次啓動時顯示幫助屏幕的代碼。運行Zxing第一次顯示白色背景的相機

我已經commeneted方法「showHelpOnFirstLaunch()」方法,並嘗試運行它,它顯示如下所示:

enter image description here

但是從secong時間它的偉大工程......我不知道如何解決這個..任何人都可以請求幫助?

+0

你在真實設備或模擬器上運行? – Venky

+0

只能在真實的設備上..從第二次它運作良好..但在這裏第一次它顯示mw像這樣 – Kanika

+0

PreferenceManager.setDefaultValues(this,R.xml.preferences,true);在showHelpOnFirstLaunch()方法之前添加此行 – Venky

回答

0

終於得到了解決:

這只是因爲背景色:在captureActivity,的onResume()方法 - >其中ViewFinderView ID初始化,我剛纔設置viewFinderView的顏色:

ViewFinderView.setBackgroundColor(0); 

那all..And現在其工作罰款:)

0

內showHelpOnFirstLaunch()你將有下面的代碼片段:

if (currentVersion > lastVersion) { 
      prefs.edit() 
        .putInt(PreferencesActivity.KEY_HELP_VERSION_SHOWN, 
          currentVersion).commit(); 
      Intent intent = new Intent(this, HelpActivity.class); 
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); 
      String page = lastVersion == 0 ? HelpActivity.DEFAULT_PAGE 
        : HelpActivity.WHATS_NEW_PAGE; 
      intent.putExtra(HelpActivity.REQUESTED_PAGE_KEY, page); 
      startActivity(intent); 
      return true; 
} 

只是註釋內showHelpOnFirstLaunch這個代碼();也叫showHelpOnFirstLaunch()方法

+0

現在它再次向我展示相同的視圖,但從showHelpOnFirstLaunch()引發異常:android.content.pm.PackageManager $ NameNotFoundException:com。 google.zxing.client.android 06-25 13:35:38.169:W/CaptureActivity(31692):\t at android.app.ContextImpl $ ApplicationPackageManager.getPackageInfo(ContextImpl.java:1734) 06-25 13:35: 38.169:W/CaptureActivity(31692):\t at com.google.zxing.client.android.CaptureActivity.showHelpOnFirstLaunch(CaptureActivity.java:690) – Kanika

+0

Post some code snippet – Venky

相關問題