Killing application process when we press on quit button

This commit is contained in:
Erwan Croze 2016-12-13 14:16:08 +01:00
parent 023add7d5e
commit bb3ae4fbd2

View file

@ -1077,6 +1077,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
public void quit() { public void quit() {
finish(); finish();
stopService(new Intent(Intent.ACTION_MAIN).setClass(this, LinphoneService.class)); stopService(new Intent(Intent.ACTION_MAIN).setClass(this, LinphoneService.class));
android.os.Process.killProcess(android.os.Process.myPid());
} }
@Override @Override
@ -1614,7 +1615,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
accountsList.setOnItemClickListener(new AdapterView.OnItemClickListener() { accountsList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override @Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
if(view != null) { if(view != null && view.getTag().toString() != null) {
int position = Integer.parseInt(view.getTag().toString()); int position = Integer.parseInt(view.getTag().toString());
LinphoneActivity.instance().displayAccountSettings(position); LinphoneActivity.instance().displayAccountSettings(position);
} }