Android Service not initializing variables from settings
<p>I am running into a problem with my application that I cannot seem to figure out.</p>

<p>The application has a service that starts when the phone starts, or if it has been stopped, starts when the main activity is run before everything else is done.</p>

<p>In the activity's onCreate I have:</p>

<pre><code>serviceIntent.setClass(this, Service.class);
bindService(serviceIntent, mConnection, Context.BIND_AUTO_CREATE);
startService(serviceIntent);
WriteDisplay();

public void WriteDisplay(){
TextView t = (TextView)findViewById(R.id.tv1);
String strdisplay = Service.getDisplay();
t.setText(strdisplay);
}
</code></pre>

<p>In the Service I have:</p>

<pre><code>    @Override 
public void onCreate(){
    super.onCreate();
    GetSettings();

}
public static String getDisplay() {
    return display;
}
</code></pre>

<p>GetSettings populates the value of display that is returned in getDisplay() from a settings.xml file.</p>

<p>However when I load up any code in the activity it simply fails and returns nothing but null values.</p>

<p>I have a refresh button on the screen that invokes DrawCanvas(); again, and if I hit the refresh button it is able to grab all the variables properly and processes the code.</p>

<p>I don't understand why the variables are not loaded on the first run of the activity, but loads properly when I hit the refresh button.</p>
