@ Override protected String doInBackground ( String ... params ) { // get the string from params, which is an array String user = params [ 0 ] ; String password = params [ 1 ] ; String bugTitle = params [ 2 ] ; String bugDescription = params [ 3 ] ; String deviceInfo = params [ 4 ] ; String targetUser = params [ 5 ] ; String targetRepository = params [ 6 ] ; String extraInfo = params [ 7 ] ; String gitToken = params [ 8 ] ; IssueService service ; if ( user . equals ( "" ) ) { service = new IssueService ( new GitHubClient ( ) . setOAuth2Token ( gitToken ) ) ; } else { service = new IssueService ( new GitHubClient ( ) . setCredentials ( user , password ) ) ; } Issue issue = new Issue ( ) . setTitle ( bugTitle ) . setBody ( bugDescription + "\n\n" + deviceInfo + "\n\nExtra Info: " + extraInfo ) ; try { issue = service . createIssue ( targetUser , targetRepository , issue ) ; return "ok" ; } catch ( IOException e ) { e . printStackTrace ( ) ; return e . toString ( ) ; } }
This is run in a background thread