title: statusbar class reflection
body: <p>I'm trying to get this piece of code put right but the "statusbar" word gets underlined with a huge message telling me that I must use one of the following provided keywords.</p>
  
  <p>Image of what I have in android studio editor:
  <a href="https://i.stack.imgur.com/vJaan.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>I want to get somehow access to the statusbarManager to disable expansion.</p>
  
  <p>Is there a workaround?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>       try{
          Object sbservice = getSystemService( "statusbar" );
          Class&lt;?&gt; statusbarManager = Class.forName("android.app.StatusBarManager");
          Method showsb = statusbarManager.getMethod( "expand" );
          showsb.invoke(sbservice)
      }catch(ClassNotFoundException e)
      {e.printStackTrace();}
      catch (NoSuchMethodException e)
      {e.printStackTrace();}
      catch(IllegalAccessException e)
      {e.printStackTrace();}
      catch (InvocationTargetException e)
      {e.printStackTrace();}
  </code></pre>