android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context r

出现这种情况很可能是因为你在service或者是其他地方调用activoty。

解决办法:

Intent intent = new Intent();
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //关键之处
				intent.setAction(Intent.ACTION_DIAL);
				startActivity(intent);


你可能感兴趣的:(android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context r)