在Service中开启一个Activity时注意 添加:mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 否则程序会报错!!! private void startNewActivity() { Log.d(TAG, "startNewActivity"); Intent mIntent = new Intent(); Log.d(TAG, "startNewActivity 1111"); ComponentName comp = new ComponentName("com.fly.wwc.MBPhone", "com.fly.wwc.MBPhone.MBPhone"); Log.d(TAG, "startNewActivity 2222"); mIntent.setComponent(comp); Log.d(TAG, "startNewActivity 3333"); mIntent.setAction("android.intent.action.MAIN"); // when you start an activity in the service, you must add this mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Log.d(TAG, "startNewActivity 44444"); startActivity(mIntent); }