2011-12-31 37 views
1

我想從MonoDroid中使用RedLaserSDK.java。來自MonoDroid的RedLaserSDK.java

  • 我已經包括redlasersdk.jar作爲AndroidJavaLibrary
  • 我已經包括RedLaserSDK.java作爲AndroidJavaSource
  • 我已經包含佈局/ video_view.axml
  • 我已經包括繪製/ overlay_logo。 PNG
  • 我已經包括原材料/ beep.ogg

我的MainActivity看起來是這樣的:

[Activity (Label = "MainActivity", MainLauncher = true)] 
public class MainActivity : TabActivity 
{ 
    protected override void OnCreate (Bundle bundle) 
    { 
    base.OnCreate(bundle); 

    // Set our view from the "main" layout resource 
    SetContentView(Resource.Layout.Main); 

    TabHost tabHost = TabHost; 

    // Tab for Scan 
    TabHost.TabSpec scanspec = tabHost.NewTabSpec("Scan"); 
    scanspec.SetIndicator("", Resources.GetDrawable(Resource.Drawable.icon_scan_tab)); 
    Intent scanIntent = new Intent(this, Java.Lang.Class.ForName("com.ebay.rlsample.RedLaserSDK")); 
    scanspec.SetContent(scanIntent); 

    tabHost.AddTab(scanspec); // Exception occurs here.... 
    } 
} 

但我得到一個ActivityNotFound例外:無法明確查找類的MyApp的/ MyApp.com.ebay.rlsample.RedLaserSDK「

什麼我可能有錯誤的有什麼想法?

+0

或者,沒有人知道如何得到正確的包和類名的Java源代碼的活動?即使我需要打開apt文件來弄清楚。 – ConsultUtah 2011-12-31 23:29:28

回答

2

我所缺少的是:

<activity android:name="com.ebay.rlsample.RedLaserSDK" android:label="RedLaserSDK"/> 
+0

遵循你的腳步,我爲最新的RedLaserSDK(3.0.3)創建了[TestApplication](https://github.com/pcoder/RedLaserDroid)。非常感謝。 – PCoder 2013-03-27 21:04:44