Ahmed
Ahmed

Reputation: 824

calling systems setting Activity from service?

I want to call android settings activity from service , i have use this code but it is not working .

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);

Upvotes: 0

Views: 621

Answers (1)

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132982

try this :

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);

Upvotes: 1

Related Questions