Added generic code in MainActivity for robot
This commit is contained in:
@@ -4,15 +4,34 @@ import android.app.Activity;
|
||||
import android.media.MediaRecorder;
|
||||
import android.os.Bundle;
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
public class MainActivity extends RobotActivity implements RobotLifecycleCallbacks {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
/* Since this is our main activity, we can start our audio recording service here */
|
||||
|
||||
|
||||
|
||||
// Register the RobotLifecycleCallbacks to this Activity.
|
||||
QiSDK.register(this, this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
// Unregister the RobotLifecycleCallbacks for this Activity.
|
||||
QiSDK.unregister(this, this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusGained(QiContext qiContext) {
|
||||
// The robot focus is gained.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusLost() {
|
||||
// The robot focus is lost.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusRefused(String reason) {
|
||||
// The robot focus is refused.
|
||||
}
|
||||
}
|
@@ -29,11 +29,11 @@ public class SpeechGenerator {
|
||||
}
|
||||
|
||||
/**
|
||||
* Default constructor, sets the language to English
|
||||
* Default constructor, sets the language to Dutch
|
||||
*/
|
||||
public SpeechGenerator()
|
||||
{
|
||||
this("en");
|
||||
this("nl");
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user