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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:24:13+00:00 2026-06-08T19:24:13+00:00

I have created an filter for android.net.conn.CONNECTIVITY_CHANGE . I do receive intents to my

  • 0

I have created an filter for android.net.conn.CONNECTIVITY_CHANGE.
I do receive intents to my broadcastreceiver.

My question is regarding what raises the connectivity_change.
The API description says:

A change in network connectivity has occurred. A connection has either
been established or lost. The NetworkInfo for the affected network is
sent as an extra; it should be consulted to see what kind of
connectivity event occurred.

It seems my broadcastreceiver is only called when mobile network is connected/disconnected (pdp is broken). It is not raised when for example 2g switches to 3g.

Can I not catch 2g to 3g swaps with this broadcastreceiver?
Do I have to use a phonestatelistener instead to catch swaps from e.g, 2g to 3g?

  • 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-08T19:24:15+00:00Added an answer on June 8, 2026 at 7:24 pm

    You need:

    permission "android.permission.READ_PHONE_STATE" //to get connection changes (2G/3G/etc)
    permission "android.permission.ACCESS_COARSE_LOCATION" //to get Cell/Tower changes

    and

    //Make the listener
    listener = new PhoneStateListener() { 
        public void onDataConnectionStateChanged(int state, int networkType) 
        { 
           //We have changed proticols, for example we have gone from HSDPA to GPRS
           //HSDPA is an example of a 3G connection 
           //GPRS is an example of a 2G connection
        }
        public void onCellLocationChanged(CellLocation location) {
           //We have changed to a different Tower/Cell
        }
    };
    
    //Add the listener made above into the telephonyManager
    telephonyManager.listen(listener, 
            PhoneStateListener.LISTEN_DATA_CONNECTION_STATE //connection changes 2G/3G/etc
            | PhoneStateListener.LISTEN_CELL_LOCATION       //or tower/cell changes 
    ); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created Broadcast receiver <receiver android:name=.IncomingBroadcastReceiver> <intent-filter> <action android:name=android.intent.action.PHONE_STATE></action> </intent-filter> </receiver> declared it
I have created a spring security Filter as below. <!-- Enables Spring Security -->
I have a DirectShow filter created with Delphi Pro 6 and the DSPACK direct
i have a created android project and within it i have created two package
I have created a BroadcastReceiver to detect SDCard mount and unmount event, however, I
I have created a Android Application with one Activity and package name com.explore <category
I have created an android application using eclipse, but when i run it, i
I want a filter for my ListView in Android. I have found this link
I have created three Activities for an Android app: BaseballCardsList, BaseballCardsDetails, and FilterBaseballCards. BaseballCardsList
how is support all platform version on my single android app.i have created one

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.