mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
fix NPE: not all spinners have adapters
This commit is contained in:
parent
1170a31385
commit
96ca4f9946
1 changed files with 5 additions and 3 deletions
|
@ -425,8 +425,8 @@ public class LocUtils {
|
|||
|
||||
private static void xlateView( Context context, View view, int depth )
|
||||
{
|
||||
DbgUtils.logf( "xlateView(depth=%d, view=%s, canRecurse=%b)", depth,
|
||||
view.getClass().getName(), view instanceof ViewGroup );
|
||||
// DbgUtils.logf( "xlateView(depth=%d, view=%s, canRecurse=%b)", depth,
|
||||
// view.getClass().getName(), view instanceof ViewGroup );
|
||||
if ( view instanceof Button ) {
|
||||
Button button = (Button)view;
|
||||
String str = xlateString( context, button.getText().toString() );
|
||||
|
@ -444,7 +444,9 @@ public class LocUtils {
|
|||
}
|
||||
}
|
||||
SpinnerAdapter adapter = sp.getAdapter();
|
||||
sp.setAdapter( new XlatingSpinnerAdapter( context, adapter ) );
|
||||
if ( null != adapter ) {
|
||||
sp.setAdapter( new XlatingSpinnerAdapter( context, adapter ) );
|
||||
}
|
||||
}
|
||||
|
||||
// A Spinner, for instance, ISA ViewGroup, so this is a separate test.
|
||||
|
|
Loading…
Add table
Reference in a new issue