Make all the methods in WifiP2pDeviceStatus static as the global method. Remove the registered BroadcastReceiver.