Skip to content

Instantly share code, notes, and snippets.

@illuzor
Created October 6, 2018 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save illuzor/b1d7e2da9a83ed76bf9858b89c0a1e5d to your computer and use it in GitHub Desktop.
Save illuzor/b1d7e2da9a83ed76bf9858b89c0a1e5d to your computer and use it in GitHub Desktop.
package com.illuzor.buildtest;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button = findViewById(R.id.btn);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, R.string.hello, Toast.LENGTH_LONG).show();
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment