i am new to android developing and i am looking at the code of the guy who worked here before. I check to connect to a server. That works great (see D/ConnectivityChecker(29802): isOnline=true). Then i create a new Intent and set a flag (public static int ONLINE\_FLAG = 1) as you can see in intent.setFlags 1. Then i send this intent via sendBroadcast to my connectionChangeReceiver.

And if i read out the intents flag it is not 1 it is 17!

This is the code of the connectionChangeReceiver:

```
/**
 * Receives notifications about connectivity changes
 */
private BroadcastReceiver connectionChangeReceiver = new BroadcastReceiver() {

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d("connectionChangeReceiver","Intent.Flags(): '" + intent.getFlags() + "' ICM.ONLINE_FLAG: '" + InternetConnectionManager.ONLINE_FLAG+"'");
        setOnlineMode(intent.getFlags() == ICM.ONLINE_FLAG);
    }

};

```

This is the logcat:

```
05-08 14:28:05.615: V/ICM(29802): checkConnectivity
05-08 14:28:05.615: V/ICM(29802): ConnectivityChecker.execute()
05-08 14:28:05.620: D/ConnectivityChecker(29802): doInBackground
05-08 14:28:05.620: D/ConnectivityChecker(29802): Host: 192.168.2.109 Port:8000
05-08 14:28:05.670: V/ICM(29802): checkConnectivity
05-08 14:28:08.670: D/ConnectivityChecker(29802):  isOnline=true
05-08 14:28:08.670: D/ConnectivityChecker(29802): intent.setFlags 1
05-08 14:28:08.670: D/ConnectivityChecker(29802): sendBroadcast(intent)
05-08 14:28:08.675: D/connectionChangeReceiver(29802): Intent.Flags(): '17' ICM.ONLINE_FLAG: '1'

```

The intentFlag is set by the ConnectivityChecker to 1 but the connectionChangeReceiver gets a 17. And i dont know why?

I check it twice. This is the only part of code where an Intent will be created and the function setFlags() will be called. The variable ONLINE\_FLAG is set to "public static int ONLINE\_FLAG = 1;" its the same variable i can call with ICM.ONLINE\_FLAG.

I dont know why the intent's Flag is 17 ??

Maybe someone can help me to fix it.

EDIT:
Sorry i forgot the code to create the intent:

```
private class ConnectivityChecker extends AsyncTask<Void, Void, Void> {

        @Override
        protected Void doInBackground(Void... params) {
            Log.d("ConnectivityChecker","doInBackground");
            Socket socket = null;
            boolean online = false;
            try {
                Log.d("ConnectivityChecker","Host: "+ConnectionHandler.host+" Port:"+ConnectionHandler.port);
                socket = new Socket();
                socket.bind(null);
                InetSocketAddress address = new InetSocketAddress(ConnectionHandler.host, ConnectionHandler.port);
                socket.connect(address, TIMEOUT * 1000);
                online = socket.isConnected();
                socket.close();
            } catch (IOException e) {
                // Nothing to do since we are just interested in the
                // availability of the server
            }
            Log.d("ConnectivityChecker"," isOnline=" + online);
            Log.d("ConnectivityChecker"," new Intent (" + CONNECTIVITY_ACTION+")");
            Intent intent = new Intent(CONNECTIVITY_ACTION);
            if (online){
                intent.setFlags(ONLINE_FLAG);
                Log.d("ConnectivityChecker","intent.setFlags " + ONLINE_FLAG);

            }

            isServerAvailable = online;

            Log.d("ConnectivityChecker","sendBroadcast(intent)");
            sendBroadcast(intent);

            return null;
        }

    };

```