자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 Q&A 이용 (제품 구매 고객 한정)

안드로이드 스튜디오로 전화바로걸기 어플을 만들고 있는데.... 잘안되서 도움좀 얻고자합니다..

다이얼 화면으로 불러 오는 것은 잘되는데

다이얼 화면 없이.. 버튼 클릭하면 바로 전화거는 기능은 작동하지 않고.. 오류가 나네요

 

여기저기 다 찾아봐도 다 같은 내용들 뿐이라.. 어찌 해야 할지 모르겟습니다

머가 잘못 된걸까요???

 

 

 

 

퍼미션
startActivity(new Intent("android.intent.action.CALL", Uri.parse(tel)));
startActivity(new Intent("android.intent.action.DIAL", Uri.parse(tel)));

 

 

 

 

자바소스

package jsh.exam.call;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class main extends Activity implements OnClickListener {
 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  Button bt1 = (Button) findViewById(R.id.button1);
  bt1.setText("바로전화걸기");
  Button bt2 = (Button) findViewById(R.id.button2);
  bt2.setText("다이얼로표시");

  bt1.setOnClickListener(this);
  bt2.setOnClickListener(this);

 }

 @Override
 public void onClick(View arg0) {
  // TODO Auto-generated method stub

  switch (arg0.getId()) {

  case R.id.button1:

   startActivity(new Intent("android.intent.action.CALL",
     Uri.parse("tel:010-0000-0000")));
   break;

  case R.id.button2:

   startActivity(new Intent("android.intent.action.DIAL",
     Uri.parse("tel:010-0000-0000")));

   break;
  }

 }
}

 

 

 

 

 

XML 소스

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent">
 <Button
  android:text="Button"
  android:id="@+id/button1"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"></Button>
 <Button
  android:text="Button"
  android:id="@+id/button2"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"></Button>
</LinearLayout>
 

 

번호 제목 글쓴이 날짜 조회 수
공지 [프로그래밍 강의] 2021.6~2021.12 관리자 2015.01.22 19791
공지 유용한 관련 사이트 관리자2 2014.03.20 58761
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 102313
1919 [베를린 웨비나] 버전이 너무 자주 바뀌는데 앞으로의 정책이나 방향에 대한 것은 없나요. 험프리 2016.05.04 189
1918 interbase 사용자 또는 비밀번호 알수있는 방법 있나요? [1] secret 푸르름 2016.05.04 4
1917 VCL 소스 폴더와 ShellControls 컴포넌트가 왜 없나요? (XE10) [1] 서어 2016.05.04 250
1916 베를린의 다이나믹 리스트뷰에서 정렬하는 방법을 알고 싶습니다. [1] file 거북이 2016.05.09 138
1915 안드로이드 스플래쉬 이미지 나인패치 적용 문제 레드 2016.05.10 579
1914 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 10 - Exercise 1 [1] 관리자 2016.05.10 182
1913 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 10 - Exercise 2 [1] 관리자 2016.05.10 129
1912 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 10 - Exercise 3 [1] 관리자 2016.05.10 158
1911 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 11 - Exercise 1 [1] 관리자 2016.05.10 169
1910 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 11 - Exercise 2 [1] 관리자 2016.05.10 155
1909 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 11 - Exercise 3 [1] 관리자 2016.05.10 124
1908 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 11 - Exercise 4 [1] 관리자 2016.05.10 148
1907 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 11 - Exercise 5 [1] 관리자 2016.05.10 160
1906 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 11 - Exercise 6 [1] 관리자 2016.05.10 138
1905 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 11 - Exercise 7 [1] 관리자 2016.05.10 158
1904 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 12 - Exercise 1 [1] 관리자 2016.05.10 285
1903 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 12 - Exercise 2 [1] 관리자 2016.05.10 155
1902 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 12 - Exercise 3 [1] 관리자 2016.05.10 143
1901 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 12 - Exercise 4 [1] 관리자 2016.05.10 149
1900 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 12 - Exercise 5 [1] 관리자 2016.05.10 199