-1

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.

optizyme
  • 1
  • 1

1 Answers1

0

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.

vt.
  • 436
  • 6
  • 12
  • Thank you very much for your help. I installed aLogRec and here is my log and error : http://www.mediafire.com/?yxy8jj4kmh5ja9v W/dalvikvm( 796): D/dalvikvm( 796): VFY: replacing opcode 0x71 at 0x0047 D/AndroidRuntime( 796): Shutting down VM W/dalvikvm( 796): threadid=1: thread exiting with uncaught exception (group=0x409ee1f8) D/OpenGLRenderer( 368): Flushing caches (mode 1) E/AndroidRuntime( 796): FATAL EXCEPTION: main E/AndroidRuntime( 796): java.lang.NoClassDefFoundError: com.android.future.usb.UsbManager E/AndroidRuntime( 796): at com.st.android.iNemoDemo.ADKActivity.onCreate – optizyme Jun 11 '12 at 05:37
  • I think i found the solution : http://stackoverflow.com/questions/9842697/android-app-future-usb-usbmanager I will give a try this evening. – optizyme Jun 11 '12 at 07:40