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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:10:46+00:00 2026-06-06T08:10:46+00:00

I have a Fragment with ImageView . How I can show this Fragment on

  • 0

I have a Fragment with ImageView. How I can show this Fragment on top system android ActionBar?

For: Wottah
ActionBar should be visible. It is necessary that the overlap would be my piece of it. We need to use something on this:

ImageView view = new ImageView (getActivity ());
view.setBackgroundColor (Color.GREEN); 
WindowManager.LayoutParams p = new WindowManager.LayoutParams (); 
p.gravity = Gravity.TOP;
p.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL; 
p.token = view.getWindowToken (); 
WindowManager mWindowManager = (WindowManager) getActivity (). GetSystemService(Context.WINDOW_SERVICE); 
mWindowManager.addView (view, p);
  • 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-06T08:10:49+00:00Added an answer on June 6, 2026 at 8:10 am

    Wottah, unfortunately your answer did not help. I looked up the source files of the android popupwindow and their decision to apply in my project.

    The task: we have application. And standart android actionbar that (as we know) is a separate part of the application and my view may not be evidence on top of it.

    The solution of the following:
    My view:

    private class MyView extends ImageView
    {
        public MyView(Context context)
        {
            super(context);
        }
    
        //it must be override
        @Override
        public boolean onKeyDown(int keyCode, KeyEvent event)
        {
            if (keyCode == KeyEvent.KEYCODE_BACK)
            {
                activity.onBackPressed();
            }
            return super.onKeyDown(keyCode, event);
        }
    }
    

    How do I use it:

    private void createMyView()
        {
            view = new MyView(activity.getBaseContext());
            view.setBackgroundResource(R.drawable.*******);
            WindowManager mWindowManager = (WindowManager) activity.getSystemService(Context.WINDOW_SERVICE);
            WindowManager.LayoutParams p = new WindowManager.LayoutParams();
            p.width = iconWidth;
            p.height = iconHeight;
            p.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
            p.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
            p.token = view.getWindowToken();
            p.gravity = Gravity.TOP;
            p.x = x;
            p.format = PixelFormat.TRANSLUCENT;
            mWindowManager.addView(view, p);
    
            view.setOnClickListener(new OnClickListener()
            {
                @Override
                public void onClick(View v)
                {
                    //TODO
                }
            });
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have fragment that on a component click pop-ups DialogFragment. This dialog fragment holds
I have this fragment that demonstrates the problem: <html> <head> <title>height query demo</title> <script
I have a template fragment that looks like this: <#+ if (length == 0)
I have a Fragment that has contains lots of info (article) with a tabhost
I have a fragment that I need to display on the screen. I want
Suppose I have a ViewGroup that can contain several optional children views, say a
I have a fragment which has its own state (selected buttons, etc). That state
I have a fragment which pulls down data from a webservice and displays this
I have a fragment (F1) with a public method like this public void asd()
I have a fairly simply Fragment that adds a handful of colored ImageViews 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.