Bug 912524: Do not reinflate SuggestionOptIn ViewStub. r=bnicholson

This commit is contained in:
Michael Comella 2013-09-10 10:00:47 -07:00
parent b242283bdf
commit 19483e1fb9

View File

@ -457,6 +457,12 @@ public class BrowserSearch extends HomeFragment
} }
private void showSuggestionsOptIn() { private void showSuggestionsOptIn() {
// Return if the ViewStub was already inflated - an inflated ViewStub is removed from the
// View hierarchy so a second call to findViewById will return null.
if (mSuggestionsOptInPrompt != null) {
return;
}
mSuggestionsOptInPrompt = ((ViewStub) mView.findViewById(R.id.suggestions_opt_in_prompt)).inflate(); mSuggestionsOptInPrompt = ((ViewStub) mView.findViewById(R.id.suggestions_opt_in_prompt)).inflate();
TextView promptText = (TextView) mSuggestionsOptInPrompt.findViewById(R.id.suggestions_prompt_title); TextView promptText = (TextView) mSuggestionsOptInPrompt.findViewById(R.id.suggestions_prompt_title);