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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:03:27+00:00 2026-05-29T10:03:27+00:00

i have set a notification when user enters in specific location. what happen when

  • 0

i have set a notification when user enters in specific location. what happen when user enter the radius phone show notification at notification bar and vibrate again and again. even i clear the notification phone keep vibration please help me out!
here is code for notification:

import android.app.Dialog;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;


    public class ProximityIntentReceiver extends BroadcastReceiver {

    private static int NOTIFICATION_ID = 0;
    public static final String EVENT_ID_INTENT_EXTRA = "EventIDIntentExtraKey";
    public static final String PLACE_NAME = "PLACE";
    public static final String ITEM_NAME = "ITEM";
    String Place_Name = "",Item_Name = "";


    @Override
    public void onReceive(Context context, Intent intent) {
         Log.v("entered","" );
        String key = LocationManager.KEY_PROXIMITY_ENTERING;
        //Bundle extras = getIntent().getExtras(); 
        NOTIFICATION_ID = intent.getIntExtra(EVENT_ID_INTENT_EXTRA, -1);
        Place_Name = intent.getStringExtra(PLACE_NAME);
        Item_Name =  intent.getStringExtra(ITEM_NAME);
        Boolean entering = intent.getBooleanExtra(key, false);
         Log.v(Place_Name,Item_Name );

        if (entering) {
            Log.d(getClass().getSimpleName(), "entering");
        }
        else {
            Log.d(getClass().getSimpleName(), "exiting");
        }


        NotificationManager notificationManager = 
            (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

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

        Notification notification = createNotification();
        notification.setLatestEventInfo(context, "Hello You are near to this", Place_Name + "  and your task is  " + Item_Name, pendingIntent);

        notificationManager.notify(NOTIFICATION_ID, notification);

    }

    private Notification createNotification() {
        Notification notification = new Notification();

        notification.icon = R.drawable.newnotification;
        notification.when = System.currentTimeMillis();

        notification.flags |= Notification.FLAG_AUTO_CANCEL;
        notification.flags |= Notification.FLAG_SHOW_LIGHTS;

        notification.defaults |= Notification.DEFAULT_VIBRATE;
        notification.defaults |= Notification.DEFAULT_LIGHTS;

        notification.ledARGB = Color.WHITE;
        notification.ledOnMS = 1500;
        notification.ledOffMS = 1500;

        return notification;
    }
}

what im doing wrong ?

  • 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-29T10:03:28+00:00Added an answer on May 29, 2026 at 10:03 am

    Try this:

    notification.defaults |= Notification.DEFAULT_LIGHTS;
    notification.defaults |= Notification.FLAG_ONLY_ALERT_ONCE;
    notification.defaults |= Notification.DEFAULT_SOUND;
    notification.flags |= Notification.FLAG_AUTO_CANCEL;
    notification.defaults |= Notification.DEFAULT_VIBRATE;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developing an App where the user can create event and set notification
We have set up a system where notifications get sent to a user with
I currently have a notification that displays in the notification bar and when the
I want to setup local notification for a specific EST time, and user should
I have a view controller which contains a field for user to enter date
I have an alarm clock in which i have set a local notification on
I have set a canvas' background to an image of a company logo. I
I have set up transactional replication between two SQL Servers on different ends of
I have set up a version control system using TortoiseSVN at my home to
I have set up a Django application that uses images. I think I have

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.