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 8933815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:38:08+00:00 2026-06-15T09:38:08+00:00

This is my code for adding view: LayoutInflater layoutInflater = (LayoutInflater) this .getSystemService(Context.LAYOUT_INFLATER_SERVICE); TextView

  • 0

This is my code for adding view:

        LayoutInflater layoutInflater = (LayoutInflater) this
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    TextView tv = (TextView) layoutInflater.inflate(R.layout.textview, null);
    final View view = tv;
    WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, 25,
            WindowManager.LayoutParams.TYPE_STATUS_BAR,
            WindowManager.LayoutParams.FLAG_SCALED
            , PixelFormat.TRANSLUCENT);


    WindowManager wm = (WindowManager) getApplicationContext().getSystemService(WINDOW_SERVICE);
    wm.addView(view, lp);

but it’s will give me an error:

android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@41668948 — permission denied for this window type

so i add permission in android manifast

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

but still error is there, i need help!!

  • 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-15T09:38:09+00:00Added an answer on June 15, 2026 at 9:38 am

    From the code snippet, it like you’re trying to create a new status bar window, which is not possible. (There is one status bar and it is managed by the System UI.)

    Can you describe what you’re trying to do? In general you interact with the status bar using the Notification and NotificationManager APIs.

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

Sidebar

Related Questions

iam adding a contact to the device using this code long Contact_Id = 100;
HI, I have this code for extracting the href and adding it to a
1. Problem I am adding a shoutcast radio to website (appeding this code to
I am adding a Map to a fragment with this code: public class MapFragment
This question is related to following thread. Prism RegionAdapter - Removing then Adding View
I am adding a child view to a Linear Layout. The child views itself
I have code in my project as follows. I am adding view controllers' view
I'm adding a custom View to the parent layout, witch is a RelativeLayout. I
Adding a comment such as this: // TODO: Refactor this code ...creates a task
In my HypnosisViewController.m I have this code for adding a UIView subclass, HypnosisView to

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.