Created
June 9, 2020 02:31
-
-
Save godjooyoung/314434cb59156ff68bff5fd1a0cb78e8 to your computer and use it in GitHub Desktop.
로그인 버튼에 클릭 이벤트 걸었다.
Tost는 밑에 작게 잠깐 올라오는거
로그창에 sysout으로 입력도 되게함.
로그인 버튼의 버튼 id는 button임
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.hello; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.Toast; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Button btn = findViewById(R.id.button); | |
btn.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Toast.makeText(getApplicationContext(), "버튼 클릭됨", Toast.LENGTH_LONG); | |
System.out.println("버튼클릭됬음니다. 런창에 이 메세지가 뜹니다."); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment