FileDocCategorySizeDatePackage
Visibility1.javaAPI DocAndroid 1.5 API2321Wed May 06 22:41:08 BST 2009com.example.android.apis.view

Visibility1

public class Visibility1 extends android.app.Activity
Demonstrates making a view VISIBLE, INVISIBLE and GONE

Fields Summary
private android.view.View
mVictim
android.view.View.OnClickListener
mVisibleListener
android.view.View.OnClickListener
mInvisibleListener
android.view.View.OnClickListener
mGoneListener
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);
        setContentView(R.layout.visibility_1);

        // Find the view whose visibility will change
        mVictim = findViewById(R.id.victim);

        // Find our buttons
        Button visibleButton = (Button) findViewById(R.id.vis);
        Button invisibleButton = (Button) findViewById(R.id.invis);
        Button goneButton = (Button) findViewById(R.id.gone);

        // Wire each button to a click listener
        visibleButton.setOnClickListener(mVisibleListener);
        invisibleButton.setOnClickListener(mInvisibleListener);
        goneButton.setOnClickListener(mGoneListener);