fix NPEs by using existing mechanism for finding the right DlgDelegate

instance.
This commit is contained in:
Eric House 2016-07-11 11:52:55 -07:00
parent a2b7c71fc1
commit 91c561f6aa
2 changed files with 13 additions and 3 deletions

View file

@ -208,9 +208,7 @@ public class DlgDelegate {
protected void showDialog( DlgID dlgID )
{
int id = dlgID.ordinal();
if ( m_activity instanceof FragActivity ) {
s_pendings.put( id, new WeakReference<DelegateBase>(m_dlgt) );
}
s_pendings.put( id, new WeakReference<DelegateBase>(m_dlgt) );
if ( !m_activity.isFinishing() ) {
m_activity.showDialog( id );
}

View file

@ -33,4 +33,16 @@ public class DualpaneDelegate extends DelegateBase {
protected void init( Bundle savedInstanceState )
{
}
@Override
protected Dialog onCreateDialog( int id )
{
return DlgDelegate.onCreateDialog( id );
}
@Override
protected void prepareDialog( DlgID dlgId, Dialog dialog )
{
DlgDelegate.onPrepareDialog( dlgId.ordinal(), dialog );
}
}