This code is crashing whenever device is connected. The reason could be
due loss of application context. So new class which extends Application
will be creator and from the P2P manager class will be instantiated with
application context.