mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-11 08:48:06 +01:00
fix crash (race condition?) downloading dict info
Stumbled on a NPE opening up the wordlist browser configuring the first game on a new install. So now test for null there and init early if necessary. Seems to work, and won't do anything in places were not needed.
This commit is contained in:
parent
ff92c4a627
commit
7242a709cb
1 changed files with 8 additions and 1 deletions
|
@ -962,7 +962,7 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
DwnldDelegate.downloadDictInBack( m_activity, lang, name, this );
|
DwnldDelegate.downloadDictInBack( m_activity, lang, name, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mkListAdapter()
|
private void resetLangs()
|
||||||
{
|
{
|
||||||
Set<String> langs = new HashSet<String>();
|
Set<String> langs = new HashSet<String>();
|
||||||
langs.addAll( Arrays.asList(DictLangCache.listLangs( m_activity )) );
|
langs.addAll( Arrays.asList(DictLangCache.listLangs( m_activity )) );
|
||||||
|
@ -971,7 +971,11 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
}
|
}
|
||||||
m_langs = langs.toArray( new String[langs.size()] );
|
m_langs = langs.toArray( new String[langs.size()] );
|
||||||
Arrays.sort( m_langs );
|
Arrays.sort( m_langs );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void mkListAdapter()
|
||||||
|
{
|
||||||
|
resetLangs();
|
||||||
m_adapter = new DictListAdapter( m_activity );
|
m_adapter = new DictListAdapter( m_activity );
|
||||||
setListAdapterKeepScroll( m_adapter );
|
setListAdapterKeepScroll( m_adapter );
|
||||||
|
|
||||||
|
@ -1312,6 +1316,9 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
|
|
||||||
public FetchListTask( Context context )
|
public FetchListTask( Context context )
|
||||||
{
|
{
|
||||||
|
if ( null == m_langs ) {
|
||||||
|
resetLangs();
|
||||||
|
}
|
||||||
m_context = context;
|
m_context = context;
|
||||||
startProgress( R.string.progress_title, R.string.remote_empty, this );
|
startProgress( R.string.progress_title, R.string.remote_empty, this );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue