Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- thread
- 메소드
- 배열
- 스프링부트
- synchronized
- 파이썬
- c#
- 객체
- 저장소
- 자바
- JS
- class
- Docker Desktop
- Java
- 자바스크립트
- join()
- 프로그래머스스쿨
- JavaScript
- Python
- SSL
- StringBuilder
- docker
- event
- array
- AssertJ
- GIT
- Dict
- Swing
- SpringBoot
- 클래스
Archives
- Today
- Total
정리노트
[안드로이드 스튜디오/Android_Studio] 버튼 - click [단순기초] 본문
MainActivity.java에 onClicked 메소드 정의
package kr.co.company.visualtool;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void onClicked(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("tel:010-1234-5678"));
//전화 연결 화면으로 이동
//Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://m.naver.com"));
//네이버 사이트로 이동
startActivity(intent);
}
}
728x90
'app > Android_Studio' 카테고리의 다른 글
[안드로이드 스튜디오/Android_Studio] 아이콘 리소스, 문자열 리소스 간단 기본 개념 (0) | 2023.02.21 |
---|---|
[안드로이드 스튜디오/Android_Studio] res \ layout 간단 기본 개념 (0) | 2023.02.21 |