title: Getting null in return when calling model class getter methods in second activity
body: <p>First I initialized a model class all attributes value in first activity by calling its constructor like this <code>UserName userName=new UserName(&quot;UnknownPerson&quot;,&quot;7dfgdufdbid_bjd&quot;);</code> but when I'm calling the getter methods of this model class in second activity it returning null.How to get that values in second activity without intent.putExtra().Look at my Code:</p>
  <pre><code>
  public class UserName {
      String name,userId;
      public UserName(String name, String userId) {
          this.name = name;
          this.userId = userId;
      }
      public UserName() {
      }
      public String getName() {
          return name;
      }
      public String getUserId() {
          return userId;
      }
  }
  </code></pre>
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          UserName userName=new UserName(&quot;UnknownPerson&quot;,&quot;7dfgdufdbid_bjd&quot;);
          Log.d(&quot;Test&quot;,userName.getName()+&quot; &quot;+userName.getUserId());
          findViewById(R.id.button).setOnClickListener(v -&gt; {
              startActivity(new Intent(this,MainActivity2.class));
          });
      }
  }
  </code></pre>
  <pre><code>public class MainActivity2 extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main2);
          UserName userName=new UserName();
          Log.d(&quot;Test&quot;,userName.getName()+&quot; &quot;+userName.getUserId());
      }
  }
  </code></pre>