remove views before adding new one. This shouldn't be possible, but

google's received reports of it happening.
This commit is contained in:
Eric House 2014-07-24 21:46:23 -07:00
parent c3f4e5323c
commit 683302f40e

View file

@ -160,7 +160,9 @@ public class Toolbar {
int id = isLandscape ? R.id.tbar_parent_vert : R.id.tbar_parent_hor;
ViewGroup scroller = (ViewGroup)m_activity.findViewById( id );
scroller.addView( m_layout );
// Google's had reports of a crash adding second view
scroller.removeAllViews();
scroller.addView( m_layout ); // failing
}
m_layout.setVisibility( m_visible? View.VISIBLE : View.GONE );