Setter doesnt work : <p>Iam trying to make login activity
I got a problem. My setter doesnt work, i dont know why?
I have 3 classes.</p>

<p>1st one is Data with server data and getters and setters</p>

<pre><code>public class Data{

String addressesURL = "/DataSnap/rest/TServerMethods1/LookupCustomers";
String articlesURL = "/DataSnap/rest/TServerMethods1/LookupArticle";
String invoicesURL = "/DataSnap/rest/TServerMethods1/LookupInvoice";
String invoicesDetailsURL = "/DataSnap/rest/TServerMethods1/LookupInvoicePos";
String invoicesDetailsAddressesURL = "/DataSnap/rest/TServerMethods1/LookupInvoiceAddress";
String ordersURL = "/DataSnap/rest/TServerMethods1/LookupOrders";
String ordersDetailsURL = "/DataSnap/rest/TServerMethods1/LookupOrdersPos";
String ordersDetailsAddressesURL = "/DataSnap/rest/TServerMethods1/LookupOrdersAddress";
public String serverURL;
//String serverURL = "http://10.10.10.75:8081";
String username = "admin";
String password = "admin";


public String getPassword() {
    return password;
}

public void setPassword(String password) {
    this.password = password;
}

public String getUsername() {
    return username;
}

public void setUsername(String username) {
    this.username = username;
}

public String getAddressesURL() {
    return addressesURL;
}

public void setAddressesURL(String addressesURL) {
    this.addressesURL = addressesURL;
}

public String getArticlesURL() {
    return articlesURL;
}

public void setArticlesURL(String articlesURL) {
    this.articlesURL = articlesURL;
}

public String getInvoicesURL() {
    return invoicesURL;
}

public void setInvoicesURL(String invoicesURL) {
    this.invoicesURL = invoicesURL;
}

public String getInvoicesDetailsURL() {
    return invoicesDetailsURL;
}

public void setInvoicesDetailsURL(String invoicesDetailsURL) {
    this.invoicesDetailsURL = invoicesDetailsURL;
}

public String getInvoicesDetailsAddressesURL() {
    return invoicesDetailsAddressesURL;
}

public void setInvoicesDetailsAddressesURL(String invoicesDetailsAddressesURL) {
    this.invoicesDetailsAddressesURL = invoicesDetailsAddressesURL;
}

public String getOrdersURL() {
    return ordersURL;
}

public void setOrdersURL(String ordersURL) {
    this.ordersURL = ordersURL;
}

public String getOrdersDetailsURL() {
    return ordersDetailsURL;
}

public void setOrdersDetailsURL(String ordersDetailsURL) {
    this.ordersDetailsURL = ordersDetailsURL;
}

public String getOrdersDetailsAddressesURL() {
    return ordersDetailsAddressesURL;
}

public void setOrdersDetailsAddressesURL(String ordersDetailsAddressesURL) {
    this.ordersDetailsAddressesURL = ordersDetailsAddressesURL;
}

public String getServerURL() {
    return serverURL;
}

public void setServerURL(String serverURL) {
    this.serverURL = serverURL;
}}
</code></pre>

<p>2nd one is where I start my login Activity</p>

<pre><code>public class Settings extends AppCompatActivity {
//declarations

//Edittext fields for username , server, password &amp; port information
EditText edtIpurl, edtPort, edtUsername, edtPassword;
//Textviews that can be clicked
TextView databaseDel, databaseRef, magnumgmbh, contact, support;
//imagebuttons for bottom menu
ImageButton contacts, articles, invoices, orders;
//string for server URL
//String sURL = "http://";
Thread newSettingsThread;



@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings);


    setTitle("Settings");

    newSettingsThread = new Thread(){
        public void run(){
            runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    String serverURL = "http://rest.magnumgmbh.de";

                    //edtIpurl = (EditText)findViewById(R.id.edtIpurl);

                    Data newD = new Data();
                    newD.setServerURL(serverURL);
                }
            });
        }
    };
    newSettingsThread.start();




    //start activitys if bottom buttons clicked
    contacts = (ImageButton) findViewById(R.id.contacts);

    //articles activity start
    contacts.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            //start activity addresses
            Intent startAddresses = new Intent(Settings.this, Addresses.class);
            startActivity(startAddresses);
        }
    });
}}
</code></pre>

<p>And the next one is where i try to get my new serverURL</p>

<pre><code>public class Address extends AppCompatActivity{
     Thread newAddressThread;
     @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_addresses);

    //set activity name
    setTitle("Addresses");

    //new thread for network operations
    newAddressesThread = new Thread() {
        public void run() {
            //make text from json
            jsonText = new StringBuilder();
            try {
                String str;
                Data newData = new Data();


                //json dates url
                String addressesURL = newData.getAddressesURL();
                String serverUrl = newData.getServerURL();
                String username = newData.getUsername();
                String password = newData.getPassword();

                URL url = new URL(serverUrl + addressesURL);
                HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
                //String encoded = Base64.encode("admin:admin");
                String encoded = Base64.encodeToString((username+":"+password).getBytes("UTF-8"), Base64.NO_WRAP);
                urlConnection.setRequestProperty("Authorization", "Basic " + encoded);

                //check http status code
                try {
                    int statusCode = urlConnection.getResponseCode();
                    System.out.println(statusCode);
                } catch (IOException e) {

                }

                BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
                while ((str = in.readLine()) != null) {
                    jsonText.append(str);
                }
                //cast stringbuilder to string
                addressesJsonStr = jsonText.toString();
                //close IOstream
                in.close();
            } catch (MalformedURLException e1) {
                System.out.println(e1.getMessage());
            } catch (IOException e) {
                System.out.println(e.getMessage());
            }
            }
    };

    //start thread
    newAddressesThread.start();
}}
</code></pre>

<p>Hier in the third one by serverURL I got null and it thow me an exeption "<code>Protocol not found: null/DataSnap/rest/TServerMethods1/LookupCustomers</code>" so that is my problem. 
What do I wrong?</p>
