Android 呼叫系统从服务设置活动?

Android 呼叫系统从服务设置活动?,android,service,android-activity,Android,Service,Android Activity,我想从服务中调用android设置活动,我已经使用了此代码,但它不起作用 final ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.fuelgauge.PowerUsageSummary"); intent.setComponent(cn); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity( inten

我想从服务中调用android设置活动,我已经使用了此代码,但它不起作用

final ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.fuelgauge.PowerUsageSummary");
intent.setComponent(cn);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity( intent);
试试这个:

final ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.fuelgauge.PowerUsageSummary"); 
intent.setComponent(cn); 
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
intent.setFlags(Intent.FLAG_FROM_BACKGROUND);
startActivity( intent);

添加此标志
intent.setFlags(intent.flag\u来自\u背景)使用Eclipse中的adb logcat、DDMS或logcat透视图检查logcat,并查看它“不工作”时出现的消息。