Fix crashes with provisioning activity

This commit is contained in:
Sylvain Berfini 2014-07-25 11:13:07 +02:00
parent efa9921136
commit 67dd84ca83

View file

@ -66,6 +66,7 @@ public class RemoteProvisioningActivity extends Activity implements LinphoneOnRe
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
instance = this; instance = this;
LinphonePreferences.instance().setContext(this);
checkIntentForConfigUri(getIntent()); checkIntentForConfigUri(getIntent());
} }
@ -175,8 +176,12 @@ public class RemoteProvisioningActivity extends Activity implements LinphoneOnRe
} }
private void goToLinphoneActivity() { private void goToLinphoneActivity() {
LinphoneService.instance().setActivityToLaunchOnIncomingReceived(LinphoneActivity.class); if (LinphoneService.isReady()) {
finish(); // To prevent the user to come back to this page using back button LinphoneService.instance().setActivityToLaunchOnIncomingReceived(LinphoneActivity.class);
startActivity(new Intent().setClass(this, LinphoneActivity.class)); //finish(); // To prevent the user to come back to this page using back button
startActivity(new Intent().setClass(this, LinphoneActivity.class));
} else {
finish();
}
} }
} }