please help me java.lang.NullPointerException: when try to send data via outputstream in android studio. :  when i try to send a string error shows as **Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.OutputStream.write(byte[])' on a null object reference**  

    (BaseApp)this.getApplicationContext()).my.BTconnect();
 
           ((BaseApp)this.getApplicationContext()).my.beginStart();
    
    
    
            String s = "w";
            try {
                outputStream.write(s.getBytes());
            } catch (IOException e) {
                e.printStackTrace();
            }