Home > Articles > Programming > Java

Like this article? We recommend

Testing Views

Now that those two bugs are fixed, we can make it to the second screen of the application. Run the application again. And again, click the Launch Other Screen button. You'll now see a screen similar to the right side of Figure 6. You were expecting this screen to look like the left side, which shows what the Graphical Layout editor shows. What happened?

Figure 6

Figure 6 On the left is the expected look, but on the right is how it really looks

This is a simple case of seeing something different on a device than in the Eclipse resource designer. The soft keyboard gets in the way of seeing the full screen. Although there are many solutions to this, such as having the user press the Back key to hide the soft keyboard, one simple solution is to wrap the entire layout in a ScrollView container. After making this change, you'll now see that the screen looks like Figure 7. Another problem solved!

Figure 7

Figure 7 Final look with layout bug fixed

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.