Skip to content

Instantly share code, notes, and snippets.

@curioustechizen
Last active September 16, 2015 13:10
Show Gist options
  • Select an option

  • Save curioustechizen/5b8d4b820cbbd87b0b0e to your computer and use it in GitHub Desktop.

Select an option

Save curioustechizen/5b8d4b820cbbd87b0b0e to your computer and use it in GitHub Desktop.

Revisions

  1. curioustechizen revised this gist Sep 16, 2015. No changes.
  2. curioustechizen revised this gist Sep 16, 2015. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  3. curioustechizen created this gist Sep 16, 2015.
    14 changes: 14 additions & 0 deletions MainActivity
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    public class MainActivity extends Activity {

    private TextView tvHello;

    @Override
    public void onCreate(Bundle savedInstanceState) {
    setContentView(R.layout.layout);
    tvHello = (TextView) findViewById(R.id.tv_hello);
    }

    public void toggle(View v) {
    tvHello.setVisibility(View.GONE);
    }
    }
    21 changes: 21 additions & 0 deletions layout
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
    android:id="@+id/tv_hello"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello World!"
    />

    <Button
    android:id="@+id/btn_toggle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Toggle"
    android:onClick="toggle"
    />

    </LinearLayout>