I fixed the app crashing exception for Android after pressing 'back' key multiple times after opening the print window. (#149)
This commit is contained in:
		
				
					committed by
					
						
						Sebastián Katzer
					
				
			
			
				
	
			
			
			
						parent
						
							8b1f92a0a1
						
					
				
				
					commit
					ee9fba07ac
				
			@@ -347,6 +347,7 @@ public class Printer extends CordovaPlugin {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void onDestroy() {
 | 
					    public void onDestroy() {
 | 
				
			||||||
 | 
					 	if(pm != null && listener != null && command != null && view != null) {
 | 
				
			||||||
       	   pm.unsetOnPrintJobStateChangeListener();
 | 
					       	   pm.unsetOnPrintJobStateChangeListener();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       	   pm       = null;
 | 
					       	   pm       = null;
 | 
				
			||||||
@@ -356,6 +357,7 @@ public class Printer extends CordovaPlugin {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
           super.onDestroy();
 | 
					           super.onDestroy();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Invoke the callback from `pick` method.
 | 
					     * Invoke the callback from `pick` method.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user