Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- //send data, return data
- }
- catch( IOException ioe){
- return ioe;
- }
- catch (Exception e) {
- return e;
- }
- if (requestObject instanceof String) {
- //everything went alright
- }
- else if( requestObject instanceof IOException){
- Toast.makeText(this, "Unable to send data. Please retry later", Toast.LENGTH_SHORT);
- }
- else if (requestObject instanceof Exception) {
- Toast.makeText(this, ((Exception) requestObject).getMessage(), Toast.LENGTH_SHORT);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement