Keeping a bluetooth connection stablished with Sphero in several Activities SDK Sphero 2.0 Android -
several months ago, question solved in next thread: https://stackoverflow.com/questions/tagged/sphero-api?sort=newest
but now, skd sphero 2.0 has made several changes. now, when connect sphero , need move activity , keeping synchrony, , check if sphero id correct , is. problem when try find robot id:
this code in new activity, previous connected sphero spheroconnectionview :
@override
public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); final string robot_id = getintent().getstringextra(buttondriveactivity.extra_robot_id); setcontentview(r.layout.mjoystick); if (robot_id != null && !robot_id.equals("")) { mrobot =(sphero) robotprovider.getdefaultprovider().findrobot(robot_id);
...} }
the result of making .findrobot id of sphero null. please tell me wrong.thanks
Comments
Post a Comment