Fix the NPE of testSingleLine.

The javadoc of TextView.getLayout() says it "returns the Layout that is
currently being used to display the text. This can be null if the text
or width has recently changes."
setSingleLine() should change the width of a TextView in a narrow
layout. So getLayout() can be null and causing NPE in that case.

Bug: 18444422
Change-Id: If61a1fad2d3baa2e1a60049079e311a23cdf2957
1 file changed