mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-23 07:27:22 +01:00
close InviteChoicesAlert when game connects
That'll happen if QR code is used in its current location.
This commit is contained in:
parent
359e1d12d1
commit
4f17c64301
2 changed files with 24 additions and 0 deletions
|
@ -2553,6 +2553,8 @@ public class BoardDelegate extends DelegateBase
|
|||
runOnUiThread( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
InviteChoicesAlert.dismissAny();
|
||||
|
||||
if ( m_relayMissing && connected ) {
|
||||
m_relayMissing = false;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import android.content.DialogInterface;
|
|||
import android.widget.Button;
|
||||
import android.widget.RadioGroup;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -40,15 +41,36 @@ import org.eehouse.android.xw4.loc.LocUtils;
|
|||
public class InviteChoicesAlert extends DlgDelegateAlert
|
||||
implements InviteView.ItemClicked {
|
||||
|
||||
private static WeakReference<InviteChoicesAlert> sSelf;
|
||||
|
||||
public static InviteChoicesAlert newInstance( DlgState state )
|
||||
{
|
||||
InviteChoicesAlert result = new InviteChoicesAlert();
|
||||
result.addStateArgument( state );
|
||||
sSelf = new WeakReference<>(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void dismissAny()
|
||||
{
|
||||
WeakReference<InviteChoicesAlert> ref = sSelf;
|
||||
if ( null != ref ) {
|
||||
InviteChoicesAlert self = ref.get();
|
||||
if ( null != self ) {
|
||||
self.dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public InviteChoicesAlert() {}
|
||||
|
||||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
sSelf = null;
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateBuilder( final Context context, final DlgState state,
|
||||
AlertDialog.Builder builder )
|
||||
|
|
Loading…
Add table
Reference in a new issue