trying to create simple screen with a button with example code but returns problems


New member
Aug 27, 2013
Visit site
the example code that I copied in is:
* An example full-screen activity that shows and hides the system UI (i.e.
* status bar and navigation/system bar) with user interaction.
* @see SystemUiHider
public class CheckIn extends Activity {
* Whether or not the system UI should be auto-hidden after
* {@link #AUTO_HIDE_DELAY_MILLIS} milliseconds.
private static final boolean AUTO_HIDE = true;

* If {@link #AUTO_HIDE} is set, the number of milliseconds to wait after
* user interaction before hiding the system UI.
private static final int AUTO_HIDE_DELAY_MILLIS = 3000;

* If set, will toggle the system UI visibility upon interaction. Otherwise,
* will show the system UI visibility upon interaction.
private static final boolean TOGGLE_ON_CLICK = true;

* The flags to pass to {@link SystemUiHider#getInstance}.
private static final int HIDER_FLAGS = SystemUiHider.FLAG_HIDE_NAVIGATION;

* The instance of the {@link SystemUiHider} for this activity.
private SystemUiHider mSystemUiHider;

protected void onCreate(Bundle savedInstanceState) {


final View controlsView = findViewById(;
final View contentView = findViewById(;

// Set up an instance of SystemUiHider to control the system UI for
// this activity.
mSystemUiHider = SystemUiHider.getInstance(this, contentView, HIDER_FLAGS);
.setOnVisibilityChangeListener(new SystemUiHider.OnVisibilityChangeListener() {
// Cached values.
int mControlsHeight;
int mShortAnimTime;

public void onVisibilityChange(boolean visible) {
// If the ViewPropertyAnimator API is available
// (Honeycomb MR2 and later), use it to animate the
// in-layout UI controls at the bottom of the
// screen.
if (mControlsHeight == 0) {
mControlsHeight = controlsView.getHeight();
if (mShortAnimTime == 0) {
mShortAnimTime = getResources().getInteger(
.translationY(visible ? 0 : mControlsHeight)
} else {
// If the ViewPropertyAnimator APIs aren't
// available, simply show or hide the in-layout UI
// controls.
controlsView.setVisibility(visible ? View.VISIBLE : View.GONE);

if (visible && AUTO_HIDE) {
// Schedule a hide().

and the problem errors I get are:

Element type "TextView" must be followed by either attribute specifications, ">" or "/>". activity_check_in.xml line 20 Android XML Format Problem
error:Error parsing XML: not well-formed (invalid token) activity_check_in.xml line 20 Android AAPT Problem

Line 20 in the above is the second line:
public class CheckIn extends Activity {

Thanks for your help. I just need to get rid of the Problems so I can move on to working on the button in the display.


Well-known member
Oct 10, 2011
Visit site
sorry didn't read your last comment, let me think about this.

Do you have an XML file that is linked to this file? It wouldn't be referencing XML if there wasn't one. As the error doesn't even mention anything about java code. And this file contains no XML code.