我尝试在设备上运行示例程序(与附件开发套件和 stm32 相关)但无法成功修复。我导入到 eclipse,检查并且我能够在虚拟设备上运行,它运行良好。但是当我尝试在设备上运行时,它会显示“不幸的是,iNemoADK 已停止”。我在stackoverflow上进行了搜索,其中一位用户遇到了这个问题,并通过添加 setContentView(R.layout.layoutname) 解决了这个问题,但我无法解决我的问题。这是我的启动器:
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
mUsbManager = UsbManager.getInstance(this);
setContentView(R.layout.main);
/* Handle the Accessory stuff */
mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0);
IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
filter.addAction(UsbManager.ACTION_USB_ACCESSORY_DETACHED);
registerReceiver(mUsbBroadcastReceiver, filter);
final ActivityDataObject obj = (ActivityDataObject)getLastNonConfigurationInstance();
if (obj != null){
// TODO seguita la documentazione ma non funziona (???)
this.mAccessory = obj.getmAccessory();
this.mINemoInfo = obj.getmINemoInfo();
if(this.mAccessory != null){
openAccessory(this.mAccessory);
}
}
this.setStatus(mStatus);
}
这是我的整个项目:
http://www.mediafire.com/?55uarh7v5f3vl55
提前致谢。