1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-26 19:02:17 -05:00

Show popup on disconnect "Reconnect?"

This commit is contained in:
Sebastian Kaspari 2010-04-12 22:10:23 +02:00
parent 598728a2cf
commit accc655bd7

View File

@ -23,7 +23,9 @@ package org.yaaic.activity;
import java.util.Collection; import java.util.Collection;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.ServiceConnection; import android.content.ServiceConnection;
@ -359,6 +361,22 @@ public class ConversationActivity extends Activity implements ServiceConnection,
input.setEnabled(true); input.setEnabled(true);
} else { } else {
input.setEnabled(false); input.setEnabled(false);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("You disconnected from " + server.getTitle() + ". Do you want to reconnect?")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
binder.connect(server);
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
} }
} }