title: Kotlin Set Global Variable in Global Class
body: <p>I'm new to Kotlin. 
  And I need a help that I can't understand to java and kotlin.</p>
  
  <p>For Java I made it. But for kotlin I can't 
  The thing is, 
  I create a Global kotlin class 
  public class Global : Application()</p>
  
  <p>In MainFest I declared that 
   android:name=".Global"</p>
  
  <p>and in Global Class I declared a variable: </p>
  
  <pre><code>public class Global : Application() {
      open var homeAPIResponse: String = "defaultValue"
  }
  </code></pre>
  
  <p>When I set to this global variable any value, it's won't save and when I fetch the value always it's showing default value. I can't understand the java type getter and setter methods in kotlin. Please help me.</p>
  
  <p>I tried that:</p>
  
  <pre><code>global = Global()
  global.homeAPIResponse  = "2nd Text"
  
  Log.d("testingTag", "Testing modified response &gt;&gt;&gt;&gt; " + global.homeAPIResponse)
  </code></pre>
  
  <p>In log it's always showing the defaultvalue.</p>
  
  <p>=========================================================================
  Guys, my purpose is to save some value globally that, after moves one activity to another, the value will not erase. </p>
  
  <p>Please help me with proper described example cause I searched a lot on stack overflow. and coudn't get it.</p>
  
  <p>Thanks in Advance </p>