title: Add new textview in fragment after click on button in another fragment
body: <p>I have two fragments. After I click on button in the first one, it moves to the second fragment with some SharedPreferences. Everytime I click on that button, I want to add new textview under another with text from SharedPreferences in the second fragment.</p>
  
  <p>Here is code from second fragment where I want to add textviews</p>
  
  <pre><code>    public class HomeFragment extends Fragment{
  
  
      public HomeFragment() {
          // Required empty public constructor
      }
  
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  
          View view = inflater.inflate(R.layout.fragment_home, container, false);
  
          SharedPreferences sharedPreferences = this.getActivity().getSharedPreferences("MyData", Context.MODE_PRIVATE);
          String Income =sharedPreferences.getString("Income","N/A");
  
          LinearLayout m_ll = (LinearLayout) view.findViewById(R.id.home);
  
          m_ll.addView(createNewTextView(Income));
          return m_ll;
      }
  
      private TextView createNewTextView(String text) {
          final LinearLayoutCompat.LayoutParams lparams = new LinearLayoutCompat.LayoutParams(LinearLayoutCompat.LayoutParams.WRAP_CONTENT, LinearLayoutCompat.LayoutParams.WRAP_CONTENT);
          final TextView textView = new TextView(getActivity());
          textView.setLayoutParams(lparams);
          textView.setText("New text: " + text);
          return textView;
      }
  }
  </code></pre>
  
  <p>It add textview with correct text, but next time when I press the button it just change text of the textview (or create one textview on another?)</p>
  
  <p>XML</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:id="@+id/home"
  android:layout_height="match_parent"
  android:orientation="vertical"
  tools:context="com.xxxx.HomeFragment"&gt;
  
  &lt;!-- TODO: Update blank fragment layout --&gt;
  &lt;/LinearLayout&gt;
  </code></pre>