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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:43:01+00:00 2026-05-31T17:43:01+00:00

I have registered ProximityAlert in MapActivity. No problem with catching alerts in BroadcastReceiver and

  • 0

I have registered ProximityAlert in MapActivity. No problem with catching alerts in BroadcastReceiver and starting new Activity.

Beside starting new activity I want to notify MapActivity to clear overlay, proximity alert and stop count up timer.

Because broadcast receiver is in separate thread I was make a handler

public class MyHandler extends Handler {
private ProximityMapActivity MainActivity;

MyHandler(ProximityMapActivity a) {
    this.MainActivity = a;
}...

in MapActivity

public void onCreate(Bundle savedInstanceState) {
    handler = new MyHandler(this);

I have no problem with Handler from runOnFirstFix runnable I can start a count up timer.
But broadbast receiver is in separate class and I have no clue what to do

private MyHandler handler;
...
handler.sendEmptyMessage(11);

is give me null pointer exeption. When I add

handler= new MyHandler(new ProximityMapActivity());

Uncaught handler comes out.

Can you give me a hint or comment? Thank You in forward.

  • 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-31T17:43:02+00:00Added an answer on May 31, 2026 at 5:43 pm

    I forgot to add setter to my object. Now I can pass on the pointer of handler.

    in MapActivity

    public void onCreate(Bundle savedInstanceState) {
        handler = new MyHandler(this);
    ProximityAlertHelper.setHandler(handler);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have registered a component like this in my Global.asax.cs: ContainerBuilder builder = new
I have a domain registered and hosted at hostmonster. I want to create a
I have registered to ConnectivityManager.CONNECTIVITY_ACTION BroadcastReceiver, for receiving network state events, but my onReceive
i have registered a domain and now i want to host it on my
I have registered mydomain.com now i want to redirect to my IP hosting account.
I have a strange problem. To detect outgoing calls I have registered a broadcast
I have registered a trigger on window resize. I want to know how I
I have registered registerOnSharedPreferenceChangeListener with my SharedPreferences in my Activity. When I change the
A problem I have is that for years now people have signed/registered up to
I have registered my activity in the manifest as android.intent.action.SEND. Now, after pressing SHARE

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.