Reputation: 591
This is my code, what should I do?
I already declare
import com.orbotix.ConvenienceRobot;
on top
What is wrong with my code, I already follow exactly from the SDK example
import android.Manifest;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import com.orbotix.ConvenienceRobot;
import com.orbotix.DualStackDiscoveryAgent;
import com.orbotix.common.DiscoveryException;
import com.orbotix.common.Robot;
import com.orbotix.common.RobotChangedStateListener;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends Activity implements View.OnClickListener, RobotChangedStateListener {
private static final int REQUEST_CODE_LOCATION_PERMISSION = 42;
private static final float ROBOT_VELOCITY = 0.6f;
private ConvenienceRobot mRobot;
private Button front;
private Button back;
@Override
protected void onCreate( Bundle savedInstanceState ) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/*
Associate a listener for robot state changes with the DualStackDiscoveryAgent.
DualStackDiscoveryAgent checks for both Bluetooth Classic and Bluetooth LE.
DiscoveryAgentClassic checks only for Bluetooth Classic robots.
DiscoveryAgentLE checks only for Bluetooth LE robots.
*/
}
@Override
public void handleRobotChangedState(Robot robot, RobotChangedStateNotificationType type) {
switch (type) {
case Online: {
//Save the robot as a ConvenienceRobot for additional utility methods
mRobot = new ConvenienceRobot(robot);
break;
}
}
}
mRobot = new ConvenienceRobot(robot); is always underline what wrong?
Upvotes: 0
Views: 77