title: TextView not updating TEXT
body: <p>I have looked at almost all the posts on stack but haven't found anything like my problem. I have a <code>fragment</code> in a <code>viewpager</code>, and in that fragment there is an class, lets call it <code>customClass</code>. I start an activity from the <code>fragment</code>, which returns a value to the onActivityResult of the fragment. Inside it I call a method of customClass which updates a <code>textView</code> with the data retrieved from the <code>onActivityResault</code> bundle.</p>
  
  <p><strong>Fragment</strong></p>
  
  <pre><code>public class clock_fragment extends Fragment {
  
      customClass myClass;
  
      public clock_fragment() {
  
      }
  
      @Override
      public void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setHasOptionsMenu(true);
      }
  
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
          return inflater.inflate(R.layout.fragment_clock, container, false);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          if(item.getItemId() == R.id.menu_settings) {
              Intent intent = new Intent(getActivity(), SettingsActivity.class);
              startActivityForResult(intent, 0);
          }
          return super.onOptionsItemSelected(item);
      }
  
      @Override
      public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
          super.onViewCreated(view, savedInstanceState);
  
  
          myClass = new customClass();
          myClass.initializeValues(this, view);
  
      }
  
  
      @Override
      public void onActivityResult(int requestCode, int resultCode, final Intent data) {
          if (resultCode != RESULT_CANCELED) {
  
              myClass.updateTextView(data.getStringExtra("currency", "fail"));
  
          }
      }
  }
  </code></pre>
  
  <p><strong>customClass</strong></p>
  
  <pre><code>public class myClass {
  
      final String TAG = "TAG";
      Fragment fragment;
      TextView textView;
  
      public myClass() {
  
      }
  
  
      public void initializeValues(clock_fragment f, View view) {
          fragment = f;
          textView = (TextView) view.findViewById(R.id.textView);
  
      }
  
  
      public void updateTextView(String value) {
  
          textView.setText(value);
  
          //i can change its colour
          textView.setTextColor(fragment.getActivity().getResources().getColor(R.color.yellow));
  
          //i can print out its updated value, not the one being shown on the screen
          Log.e(TAG, "updateCurrencyFromPreferences: "+textView.getText());
      }
  }
  </code></pre>
  
  <p>All the methods are <strong>called</strong> fine, everything executes. I can even print out the <code>string</code> value in a log and it gives me the desired result, in all methods. The text view <strong>text DOES change</strong>, proved by a using <code>textView.getText()</code> and printing it in a log message i put in the end of <code>updateTextView(String value)</code>. </p>
  
  <p>BUT the <code>textView</code> doesn't update its text! I've tried so many things. I've considered it could have to do with the fragment not having the same <code>textView</code> reference because its being recreated after I start the <code>activity</code> and then return back. </p>
  
  <p>I can even change the <code>textColour</code> of the <code>textView</code> (in <code>updateTextView</code> method) and that also works normally, I can see it happening, though the text doesn't change. I've also tried changing the text to some random dummy text but no luck. As i said printing a log messege with <code>textView.getText()</code> shows the updated text in the log, but it doesn't match up with whats on screen (text doesnt change). I've even tried passing the <code>textView</code> from the main fragment to that specific method but alas no luck. pls help :'D</p>
  
  <p>PS: The custom class already has a reference to the <code>textView</code> that is created from a view passed into the contructer. EVERYTHING Works, no errors or assignment issues, just the text <strong>doesn't</strong> update. </p>
  
  <p>I will be happy to provide more information if this isn't enough.</p>