0 votes
in Education by (1.7m points)
I found the following piece of code from the adw launcher:

Object service = launcher.getSystemService("statusbar");

if (service != null) {

    Method expand = service.getClass().getMethod("expand");



Which throws a SecurityException: StatusBarManagerService: Neither user 123456 nor current process has android.permission.EXPAND_STATUS_BAR

So I added

<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />

to my application manifest.xml, But still no luck

JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by (1.7m points)
Object service = getSystemService( "statusbar" );

Class<?> statusbarManager = Class.forName( "android.app.StatusBarManager" );

Method expand = statusbarManager.getMethod( "expand" );

expand.invoke( service );

and add this to manifest:

<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />