Simplify registration tutorial.
This commit is contained in:
parent
454d70d2d9
commit
c7c2b93c89
1 changed files with 6 additions and 12 deletions
|
@ -42,6 +42,7 @@ public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
|
||||||
private TutorialRegistration tutorial;
|
private TutorialRegistration tutorial;
|
||||||
private Button buttonCall;
|
private Button buttonCall;
|
||||||
private Handler mHandler = new Handler();
|
private Handler mHandler = new Handler();
|
||||||
|
private TextView outputText;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,7 +56,7 @@ public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
|
||||||
sipPasswordWidget.setText(defaultSipPassword);
|
sipPasswordWidget.setText(defaultSipPassword);
|
||||||
|
|
||||||
// Output text to the outputText widget
|
// Output text to the outputText widget
|
||||||
final TextView outputText = (TextView) findViewById(R.id.OutputText);
|
outputText = (TextView) findViewById(R.id.OutputText);
|
||||||
final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText);
|
final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText);
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,6 +67,7 @@ public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
|
||||||
|
|
||||||
// Assign call action to call button
|
// Assign call action to call button
|
||||||
buttonCall = (Button) findViewById(R.id.CallButton);
|
buttonCall = (Button) findViewById(R.id.CallButton);
|
||||||
|
buttonCall.setText("Register");
|
||||||
buttonCall.setOnClickListener(new View.OnClickListener() {
|
buttonCall.setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
TutorialLaunchingThread thread = new TutorialLaunchingThread();
|
TutorialLaunchingThread thread = new TutorialLaunchingThread();
|
||||||
|
@ -74,13 +76,9 @@ public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Assign stop action to stop button
|
// Hide stop button
|
||||||
Button buttonStop = (Button) findViewById(R.id.ButtonStop);
|
Button buttonStop = (Button) findViewById(R.id.ButtonStop);
|
||||||
buttonStop.setOnClickListener(new View.OnClickListener() {
|
buttonStop.setVisibility(View.GONE);
|
||||||
public void onClick(View v) {
|
|
||||||
tutorial.stopMainLoop();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,13 +90,9 @@ public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
|
||||||
tutorial.launchTutorial(
|
tutorial.launchTutorial(
|
||||||
sipAddressWidget.getText().toString(),
|
sipAddressWidget.getText().toString(),
|
||||||
sipPasswordWidget.getText().toString());
|
sipPasswordWidget.getText().toString());
|
||||||
mHandler.post(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
buttonCall.setEnabled(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (LinphoneCoreException e) {
|
} catch (LinphoneCoreException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
outputText.setText(e.getMessage() +"\n"+outputText.getText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue