java - How to keep a Bluetooth connection when Sphero is synchronized and I use several Activities (Sphero SDK 2.0 for android) -


several months had problem when went 1 activity , wanted keep synchronism sphero time. solution passing id of sphero intent , recouping next code:

@override public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);      // robot object sent through activity     string robotid = getintent().getstringextra("robot.id");     robot robot = robotprovider.getdefaultprovider().findrobot(robotid); } 

i have same problem because of sphero sdk has changed model 2.0.

in api did same pass robotid activity (by intent), instancing robot in newest activity, doing next code doesn't work:

robot robot = robotprovider.getdefaultprovider().findrobot(robotid); sphero mrobot= (sphero) robot;

in fact, have checked if robotid filled correct value , correct, but have null value in robot.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -