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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:33:02+00:00 2026-05-19T06:33:02+00:00

I have a net service in my app, for now it doesn’t matter if

  • 0

I have a net service in my app, for now it doesn’t matter if it’s a thread in the Application context or a service, what does matter is i have some trouble getting response properly.
The service is working, and i do get responses, right now i work with the observer design patter which is a bitch in android 🙁 i have to remove the listener in on destroy and then check the network if it is all ready finished and handle different scenarios.
I want to change my approach, but i’m not sure what’s the right android way, it seems like activities are made for polling which is bad for my architecture and error prone :-(.

I thought of the folowing two methods but non seem to give me a real solution:

  1. create a braodcast receiver that
    will send a broadcase with a flag if
    response or error arrived from the
    net, it’s apt to the activity to
    poll the right data and handle. i do
    wonder about this since if i
    register for broacast i basically
    have to remove the listener in on
    pause, so i CAN miss a broadcast,
    then it’s back to check the net
    state in onCreate, same like what
    i’m doing now – sucks…
  2. register the activity that whats an event and sent it an intent using startActivity but here if the activity is in on pause or stop i’ll bring it to the front, i don’t want this kind of behavior, i only want that the activity will get the event no matter what, and starting to wonder if there’s a way to do that.

The landscape\portrait event are killing me, any way out of it ?

  • 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-19T06:33:04+00:00Added an answer on May 19, 2026 at 6:33 am

    i discovered the following:

    1. i can decide to handle the
      landscape\portrait events myself and
      then i eliminate 90% of the problem
    2. i can use Broadcast Receivers but with sticky flag on that will cause the intent to wait for me, i just have to check first if i got the intent once i’ll gt it once more if it’s sticky (meaning in landscape \ portrait i may get it twice on screen rotation)

    if i get new intent that doesn’t kill my app (depends on the intent) i get it in onNewIntent() method. i can put some init functions that are dependant on those values in a seperate init function that gathers them all to share them between onCreate and onNewIntnet.

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

Sidebar

Related Questions

I have a .NET Windows service and a .NET Web Application that I would
I have a .NET Windows Service which spawns a thread that basically just acts
I have an ASP.NET 4 web application that references a SOAP web service. I
I have been working on an ASP.NET/C# web app for some time and its
I have a Web Service for my ASP.NET MVC 3 app which creates a
I have an Android app that talks to .net web service via http over
I have an ASP.Net-MVC app using LinqToSql. I have a subcontracts table, a service_lines
We have about 7 app servers running .NET windows services that ping a single
I have a set of existing WCF services hosted in a .NET 3.0 app.
I have .Net service that listens on single port over TCP protocol. Clients connect

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.