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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:07:40+00:00 2026-06-11T00:07:40+00:00

My application should run in full screen mode. And also i have to show

  • 0

My application should run in full screen mode. And also i have to show notification bar when new items arrived to my app from our server. I write coding for notification in BroadcastReceiver class. i would like to make a decision in MainActivity like show the status bar only when new notification received otherwise hide the status bar. All are done when app is in foreground.

Coding for Notification:

Intent scheduledIntent = new Intent(context,Activity.class);

PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, scheduledIntent, 0);

                nm = (NotificationManager) context
                        .getSystemService(Context.NOTIFICATION_SERVICE);
                CharSequence from = "From address";
                CharSequence message = "New Orders received";
                Notification notif = new Notification(R.drawable.icon,"Hai", System.currentTimeMillis());
                notif.setLatestEventInfo(context, from, message, pendingIntent);
                notif.flags |= Notification.FLAG_AUTO_CANCEL;
                nm.notify(uniqueID, notif);
                notif.ledOnMS = 500;
                notif.ledOffMS = 500;

Through this code notifications are recieved. But the status bar is always visible. I need to hide when no notification received.
Please provide me the right way to do this.

Thanks in advance,

  • 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-11T00:07:42+00:00Added an answer on June 11, 2026 at 12:07 am

    In OnCreate() method you have to write this one:

     AppPreferences prefs = new AppPreferences(PresentChatActivity.this);
                 boolean notify_checkbox = prefs.getNotifyState();
    
        Notification(message.getBody(),fromName, name);
    

    Then, outside OnCreate(), write this function

       protected void Notification(String body, String fromName, String Notificationmsg) {
    
        NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);      
    
        String tickerText = getString(R.string.app_name, body);
        Notification notif = new Notification(R.drawable.ic_launcher, tickerText,
                System.currentTimeMillis());
    
        Intent notificationIntent = new Intent(this, PresentChatActivity.class);
        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
    
    
         notif.setLatestEventInfo(PresentChatActivity.this,Notificationmsg, message, pendingIntent);
         notif.setLatestEventInfo(getApplicationContext(), fromName, body,pendingIntent );  
         notificationManager.notify(10001, notif);
         }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a windows application that run in full screen and there are some
I want to run an nightly unittest of my django application. This should be
Android application should show Events happening in city as per day/month/year anywhere in the
I'm trying to start unit testing on my application (should have done so from
I have created an SMS application in .NET. I wanted that the application should
I have run into a problem with a custom wpf splash-screen implementation. The problem
I have a database called apsc and if I run SHOW TABLES; on it,
i am using togglefullscreen() function to ofc toggle between window mode & full screen
I'm writing an application that needs to display a full-screen splashscreen image on start.
I have a self-made fullscreen application for Windows 7 written in C++ which should

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.