Code example for StringWriter

Methods: toString

0
		    confirm.show().show();    
		} 
    }; 
	 
    protected void setStackTrace(Throwable aThrowable) {
        final Writer result = new StringWriter();
        final PrintWriter printWriter = new PrintWriter(result);
        aThrowable.printStackTrace(printWriter);
        errorTrace = result.toString();
    } 
     
    public void setStackAndPost(Throwable aThrowable){
    	setStackTrace(aThrowable);
    	mHandler.post(displayError);
    } 
    
	 
 
} 
Connect your IDE to all the code out there  Get Codota for Java