Can anyone help me?

How to automaticly switch off relay when bluetooth module not connected with android?

The simplest way is to send a message at regular intervals (perhaps 5 per second) and when the Arduino fails to get a message in time it will know that there has been a communication failure.

...R

Robin2:
The simplest way is to send a message at regular intervals (perhaps 5 per second) and when the Arduino fails to get a message in time it will know that there has been a communication failure.

...R

could you give me example code please sir..

I am guessing, from your Original Post, that you already have a program that sends data using Buetooth so please post that program.

You need to add some code on the receiving side something like this

if (newData == true) {    // when a new message arrives
   lastestMessageMillis = millis();
}

if (millis() - lastestMessageMillis >= maxIntervalMillis) {
  // the next message has failed to arrive
}

...R