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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:31:21+00:00 2026-06-15T17:31:21+00:00

I am attempting to implement a class for service discovery using Android’s NsdManager API.

  • 0

I am attempting to implement a class for service discovery using Android’s NsdManager API. I am wondering how one could start the service search for a fixed amount of time from the main activity, then stop it to use the results of the search?

The NsdManager API says the call should be asynchronous

The API is asynchronous and responses to requests from an application
are on listener callbacks on a seperate thread.

I have successfully sent the class a handler which updates my UI thread with the message response but I’m not sure how I can then stop the discovery service after, say, 5 seconds without blocking the Main Thread with a timer :S

I hope it is a relevant question and I have provided enough information.

Br

  • 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-15T17:31:22+00:00Added an answer on June 15, 2026 at 5:31 pm

    You don’t need to use a timer, just use postDelayed(Runnable r, long millis) on your View. You can call that from any thread, so you could call it from the callback.

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

Sidebar

Related Questions

I'm creating a Validator<T> class. I'm attempting to implement the Linq SelectMany extension methods
I am attempting to implement thread-safe usage of ConcurentHashMap within singleton spring service that
I'm attempting to implement nested object forms for my site, using Ryan Daigle's blog
I'm attempting to implement a delegate Service provider by overriding the bean definition for
I am attempting to implement a custom locale service in an MVC 2 webpage.
What I'm attempting to do is when receiving a c2dm message, start a service
I'm attempting to return all Animal objects that implement IHerd. Could someone point me
I am attempting to implement a WPF ViewModel using Castle Windsor Dynamic Proxies. The
I'm attempting to use ComparisonChain to implement compareTo() in a class however the class
I'm attempting to implement a binary tree for an Android app, and I want

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.