뭐가 잘못된건지를 더 이상은 못찾겠습니다..ㅠㅠ
======================================================================
Phone.java
package exam.Phone;
import android.app.*;
import android.content.*;
import android.net.*;
import android.os.*;
import android.view.*;
import android.widget.*;
public class Phone extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
numEdit = (EditText)findViewByld(R.id.call);
call = (Button)findViewByld(R.id.call);
call.setOnClickListener(this);
}
@Override
public void onClick(View v) {
//TODO Auto-generated method stub
if(v==call){
String number = numEdit.getText().toString();
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:"+number));
startActivity(intent);
}
}
}
===============================================================
Main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="150px"
android:layout_height="wrap_content"
android:text="전 화 번 호"
android:gravity="center"/>
<EditText
android="@+id/numEdit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<Button
android:id="@+id/call"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="전화걸기"
/>
</LinearLayout>




/** Called when the activity is first created. */
이 부분에
EditText numEdit;
Button call;
이걸 선언해주셔야합니다.
xml에서 배치한 컴포넌트들을 소스상에서 컨트롤 하기 위해서 저렇게 변수처럼 선언을 해주셔야 하는데
다른 메소드에서도 사용하시려면 전역으로 선언을 해주셔야 합니당 ~