fix crash: adding wrong item to list

This commit is contained in:
Eric House 2015-01-13 19:53:02 -08:00
parent 1139b1d5d1
commit 2073098a5e

View file

@ -53,7 +53,6 @@ public class XWConnAddrPreference extends DialogPreference {
super( context, attrs ); super( context, attrs );
m_context = context; m_context = context;
// setWidgetLayoutResource( R.layout.conn_types_display );
setDialogLayoutResource( R.layout.conn_types_display ); setDialogLayoutResource( R.layout.conn_types_display );
setNegativeButtonText( LocUtils.getString( context, R.string.button_cancel ) ); setNegativeButtonText( LocUtils.getString( context, R.string.button_cancel ) );
@ -74,7 +73,7 @@ public class XWConnAddrPreference extends DialogPreference {
CheckBox box = (CheckBox)layout.findViewById( R.id.inviter_check ); CheckBox box = (CheckBox)layout.findViewById( R.id.inviter_check );
box.setText( typ.longName( m_context ) ); box.setText( typ.longName( m_context ) );
box.setChecked( m_curSet.contains( typ ) ); box.setChecked( m_curSet.contains( typ ) );
list.addView( box ); list.addView( layout ); // failed!!!
final CommsConnType typf = typ; final CommsConnType typf = typ;
box.setOnCheckedChangeListener( new OnCheckedChangeListener() { box.setOnCheckedChangeListener( new OnCheckedChangeListener() {