I know it's kind of stupid question, but it's been a long time since I programmed Java in Android Studio. So actually I have the problem that I can't get a return from a class to another. I tried different kind of solutions suggested here, but none of them worked. Not sure why. I'm getting nothing displayed TextView in xml.

Here is the MainActivity.java:

```
public class MainActivity extends ActionBarActivity {
TextView txt_temp;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    XMLreference();
    StringRequest();
}

public void XMLreference(){
    txt_temp = (TextView) findViewById(R.id.txt_temp);
}

public void StringRequest(){
    WebServiceRequest webService = new WebServiceRequest();
    String request = webService.main();

    txt_temp.setText(request);
}

```

}

And here is the WebServiceRequest.java:

```
public class WebServiceRequest {
    private static final String username = "*********"; // put your Device Cloud username here
    private static final String password = "*********"; // put your Device Cloud password here
    public String responseContent;

    /**
     * Run the web service request
     */
    public String main() {
        HttpsURLConnection conn = null;

        try {
            // Create url to the Device Cloud server for a given web service request
            URL url = new URL("https://devicecloud.digi.com/ws/DataStream/00000000-00000000-********-********/xbee.serialIn");
            conn = (HttpsURLConnection) url.openConnection();
            conn.setDoOutput(true);
            conn.setDoInput(true);
            conn.setRequestMethod("GET");

            // Build authentication string
            String userpassword = username + ":" + password;

            // can change this to use a different base64 encoder
            String encodedAuthorization = Base64.encodeToString(userpassword.getBytes(), Base64.DEFAULT).trim();

            // set request headers
            conn.setRequestProperty("Authorization", "Basic "
                    + encodedAuthorization);

            InputStream is = conn.getInputStream();

            Scanner isScanner = new Scanner(is);
            StringBuffer buf = new StringBuffer();
            while (isScanner.hasNextLine()) {
                buf.append(isScanner.nextLine() + "\n");
            }
            responseContent = buf.toString();

            // add line returns between tags to make it a bit more readable
            responseContent = responseContent.replaceAll("><", ">\n<");

            // Output response to standard out
            // System.out.println(responseContent);

        } catch (Exception e) {
            // Print any exceptions that occur
            e.printStackTrace();
        } finally {
            if (conn != null)
                conn.disconnect();
        }
        return responseContent;
    }
}

```

I already tried to create 

```
public void getResponseContent() {
    return responseContent;
}

```

And getting it with

```
WebServiceRequest webService = new WebServiceRequest();
String request = webService.getResponsteContent();

```

But it didn't work either. I'm not sure but I'm making somewhere a stupid mistake and after hours of programming I can't find the clue to solve it.