编译能过,为什么运行的时候老是出现这样的错误呢?求高手指点迷津啊
02-04 07:22:24.677: E/AndroidRuntime(504): FATAL EXCEPTION: main
02-04 07:22:24.677: E/AndroidRuntime(504):
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel: cmp=com.android.phone/.OutgoingCallBroadcaster } from ProcessRecord{43f99af8 504:com.chong.phone/10036} (pid=504, uid=10036) requires android.permission.CALL_PHONE
02-04 07:22:24.677: E/AndroidRuntime(504): at android.os.Parcel.readException(Parcel.java:1247)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.os.Parcel.readException(Parcel.java:1235)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1298)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1373)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.app.Activity.startActivityForResult(Activity.java:2817)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.app.Activity.startActivity(Activity.java:2923)
02-04 07:22:24.677: E/AndroidRuntime(504): at com.chong.phone.MainActivity$ButtonOnClickListener.onClick(MainActivity.java:35)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.view.View.performClick(View.java:2408)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.view.View$PerformClick.run(View.java:8816)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.os.Handler.handleCallback(Handler.java:587)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.os.Handler.dispatchMessage(Handler.java:92)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.os.Looper.loop(Looper.java:123)
02-04 07:22:24.677: E/AndroidRuntime(504): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-04 07:22:24.677: E/AndroidRuntime(504): at java.lang.reflect.Method.invokeNative(Native Method)
02-04 07:22:24.677: E/AndroidRuntime(504): at java.lang.reflect.Method.invoke(Method.java:521)
02-04 07:22:24.677: E/AndroidRuntime(504): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-04 07:22:24.677: E/AndroidRuntime(504): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-04 07:22:24.677: E/AndroidRuntime(504): at dalvik.system.NativeStart.main(Native Method)
package com.chong.phone;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button=(Button) this.findViewById(R.id.button);
button.setOnClickListener(new ButtonOnClickListener());
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {