I try to run a sample program (related with accesory development kit and stm32) on device but can not be succeeded to fix. I imported to eclipse, checked and i am able to run on virtual device, it works good. But when i try to run on device it says "Unfortunately, iNemoADK has stopped". I searched all over stackoverflow, one of the user had that problem and solved by adding setContentView(R.layout.layoutname) but i can not solve my problem with this. Here is my launcher :
@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);
}
here is my whole project :
http://www.mediafire.com/?55uarh7v5f3vl55
Thanks in advance.
You didn't specify what problem your code is actually having, just the symptoms ("Unfortunately..." message is a sign of your app throwing an exception that you're not handling).
Use something like aLogRec to see what is actually happening - the problem may be obvious enough for you to figure out.