Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. try {
  2. //send data, return data
  3. }
  4. catch( IOException ioe){
  5. return ioe;
  6. }
  7. catch (Exception e) {
  8. return e;
  9. }
  10.  
  11. if (requestObject instanceof String) {
  12. //everything went alright
  13.  
  14. }
  15. else if( requestObject instanceof IOException){
  16. Toast.makeText(this, "Unable to send data. Please retry later", Toast.LENGTH_SHORT);
  17. }
  18. else if (requestObject instanceof Exception) {
  19. Toast.makeText(this, ((Exception) requestObject).getMessage(), Toast.LENGTH_SHORT);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement