2011-12-31 67 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