Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8227667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:12:05+00:00 2026-06-07T16:12:05+00:00

I am currently working on an app that can draw views over the statusbar.

  • 0

I am currently working on an app that can draw views over the statusbar.

Here is my code:

@Override
public void onCreate() {
    // TODO Auto-generated method stub
    super.onCreate();
    wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
    v = new StatusView(this);

    lp = new WindowManager.LayoutParams(
            WindowManager.LayoutParams.WRAP_CONTENT,
            WindowManager.LayoutParams.WRAP_CONTENT,
            **WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL**,
            WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                    | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
            PixelFormat.TRANSLUCENT);
    wm.addView(v, lp);
    Log.d(TAG, "Added view");
}

However I get a security exception saying I don’t have permission to use this view type.
So I tried adding several permissions. Here are the ones i’ve tried so far:

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW"/>
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.BIND_REMOTEVIEWS"/>
<uses-permission android:name="android.permission.STATUS_BAR"/>

Any suggestions? This may not be possible as the statusbar is not considered part of the window.

EDIT:

The specific error is:

android.view.WindowManager$BadTokenException: unable to add window
android.view.ViewRoot$W@40518c50 - permission denied for this window type
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:12:07+00:00Added an answer on June 7, 2026 at 4:12 pm

    Nevermind, I solved it! The problem wasn’t TYPE , but FLAGS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on an app that allows the user to draw pixelated images
I'm currently working on an app that lets the user choose an MP3 audio
I'm currently working on an app that is being created using Ironspeed Designer. It's
I am currently working on a simple Silverlight app that will allow people to
I’m currently working on a small web app that allows people to search for
I am currently working on a mobile app that is going to communicate with
I'm currently working on a metro app that requires a few textual resources. Part
I'm currently working on developing a custom keyboard app that will be optimized for
I currently started working on a maven web-app project that needs to be launched
I'm working on an app that relies heavily on P2P, but I currently don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.