FOR DEBUGGING ONLY: Got some asserts, I think because a new instance

can be coming up before another goes away.  Now we'll actually try
finish()ing a duplicate activity.
This commit is contained in:
Andy2 2011-07-15 21:24:28 -07:00
parent 808eb41d95
commit e250fb003b
2 changed files with 9 additions and 5 deletions

View file

@ -342,7 +342,9 @@ public class GamesList extends XWListActivity
// XWApp.Finishable interface
public void doFinish()
{
Assert.fail();
if ( !isFinishing() ) {
finish();
}
}
@Override

View file

@ -49,14 +49,16 @@ public class XWApp extends Application {
// hack to deal with a broken, or undocumented, aspect of Android.
public void addFinishable( Finishable obj )
{
Assert.assertNull( m_finishable );
if ( null != m_finishable ) {
m_finishable.doFinish();
}
m_finishable = obj;
}
public void clearFinishable( Finishable obj )
{
Assert.assertNotNull( m_finishable );
Assert.assertTrue( m_finishable == obj );
m_finishable = null;
if ( m_finishable == obj ) {
m_finishable = null;
}
}
}