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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:41:12+00:00 2026-06-12T12:41:12+00:00

How Can I Display an alert when push notification arrives from C2DM or GCM.

  • 0

How Can I Display an alert when push notification arrives from C2DM or GCM. Right now I am displaying notifications on status bar. So How can I get a notification as an alert.

  • 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-12T12:41:13+00:00Added an answer on June 12, 2026 at 12:41 pm

    Popping a dialog in the middle of something a user is doing is a wildly user hostile thing to do. What if they’re playing Angry Birds and you’ve just ruined their shot? Only the platform can and should get away with that.

    Use the notification area, like Google intended, UNLESS you app currently has control (your activity is in running state). Then just use that activity’s context to pop an AlertDialog(). You can detect if the activity is running by overriding onResume() and onPause() – anything that happens in between is your activity’s time.

    An AlertDialog can be popped like this:

    new AlertDialog.Builder(Ctxt) //Use an activity object here
        .setMessage(R.string.MyMessageID) //Provide a message here... A string or a string ID will do
        .setCancelable(true) //If you want them to be able to dismiss with a Back button
        .setNegativeButton(R.string.IDS_NO, null) //No action on NO, right?
        .setPositiveButton(R.string.IDS_YES, OnYesClickListener) //Plug your own listener...
        .create()
        .show();
    

    For a simple message/Yes/No dialog, an AlertDialog would suffice. For more complicated UI, derive a class from Dialog and design your own layout.

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

Sidebar

Related Questions

How can I display an alert or a message after a user clicks a
I can display a simple Visual Basic inputbox from a PowerShell script like this:
How can I display an alert with the elements second attribute grouped by the
Using CoreFoundation, I can display an alert dialog with the following: CFUserNotificationDisplayAlert(0.0, kCFUserNotificationPlainAlertLevel, NULL,
I have implemented ray wenderlich's tutorials on Apple push notification, now i want to
I can display an alert box as follows: alert('Please wait 5 seconds'); . Is
How can I display an alert after a user clicks a submit button in
Here's the response: {Message:Authentication failed.,StackTrace:null,ExceptionType:System.InvalidOperationException} how can i display an alert box with the
How can i display an alert message or alert box when getting the information(not
How i can display all applications icons and name which are installed in device

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.