Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created Jul 11, 2021
Embed
What would you like to do?
how to set button click event 1-3
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void showMessage(View view) {
Snackbar.make(view, "ボタンが押されました", Snackbar.LENGTH_SHORT).show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment