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
- 자바스크립트
- docker
- SSL
- JavaScript
- 스프링부트
- class
- Docker Desktop
- StringBuilder
- array
- 자바
- Java
- 클래스
- 객체
- Dict
- 파이썬
- 메소드
- c#
- JS
- 프로그래머스스쿨
- event
- SpringBoot
- 저장소
- join()
- AssertJ
- Python
- synchronized
- thread
- 배열
- Swing
- GIT
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 |