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

  • Home
  • SEARCH
  • 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 6026185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:24:33+00:00 2026-05-23T04:24:33+00:00

I am using android-c2dm, and my device successfully receives messages from it. I want

  • 0

I am using android-c2dm, and my device successfully receives messages from it. I want to call a non-static function (in an already-existing Activity) to do something with that message, but simply calling it from C2DMBaseReceiver is illegal. How can I transfer this information back to the activity?

Edit: What if I call a static function to assign variables (or set Shared Preferences), then call a handler which will use those variables to do what needs to be done? Is that bad style?

  • 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-23T04:24:33+00:00Added an answer on May 23, 2026 at 4:24 am

    What you could do is put the message details in an Intent somehow (the crudest way would be serialize the message to a String and add it as an Intent extra) and then send that Intent to the Activity using startActivity. The Activity could check for the extra, know that it is a message, extract and deserialize the message and then go to town.

    You might need to set the appropriate launch mode or Intent flags if you want to make sure that an existing instance of the target Activity receives the message.

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

Sidebar

Related Questions

Using restlet, I want to make a post to android's c2dm service. I have
Using Android opengl I need to move an object from point A to point
I am using Android-C2DM, and when I receive a message that has been pushed
I'am developing a sample push notification app in android using c2dm. Here is my
I am using Android Timer for a game. I want to implement a countdown
I've been reading up on Android's cloud 2 device messaging (C2DM) and all the
I'm using Android 2.3, so according to this post: Streaming Audio from A URL
I have developed push notification system in android using c2dm, It's working fine but
My app receives an intent from the C2DM servers to register for push notifications
I am developing android push notification application using C2DM,I am facing some problems in

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.