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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:03:34+00:00 2026-05-30T21:03:34+00:00

Contiuned from : This is my question So now i can use this code

  • 0

Contiuned from : This is my question

So now i can use this code :

Window a = getWindow();
    a.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

Instead of this code :

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

And some of my Senior’s said that because of getWindow(); method is returning a Window Object we can use both of the code above.
My question is : why we need to get a returned Window object from this code : Window a = getWindow();

I think when i do this i already have a Window Object

Window a;

But why is it not working?

And my 2nd question is why can’t i do like this :

Window a = new Window();

I think it’s create a Window object too.

Why must I use the getWindow(); method?

Thanks all

PS: English is not my native language, so sorry if I made some mistakes

  • 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-05-30T21:03:36+00:00Added an answer on May 30, 2026 at 9:03 pm

    I’m assuming java here:

    Window a;
    

    does not create a new Window object, it only creates a variable, which can hold an object of type Window. To create the object itself – you need to invoke its constructor, in your case – I assume that what getWindow() does.

    Also, new Window is a syntax error – constructors in java are invoked similar to methods [with () and relevant arguments, if there are any].

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

Sidebar

Related Questions

A question to windows network programming experts. When I use pseudo-code like this: reconnect:
This question is about a Java JTree or a Window .Net Tree (Winforms) or
The code for my question can be located at http://matthewh.me/Scripts/c++/graphs/ . The user name
I've heavily edited this question because responses indicated I wasn't being clear problem: UI
This is a fairly simple question. Basically, I'm having a program send HardWare ID's
Basically from a database I am getting data that is formatted like this nameofproject101
First a little background about why I'm asking this question... I'm working on a
This is somewhat of a broad question, but it is one that I continue
I've been stuck with this problem for over a week now. Hopefully some one
This question is in continuation to my previous post located here . Since there

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.