title: How can I access a TextView in a Nested Preference Screen
body: <p>I am trying to reach and update TextView through ListPreference which is located in a child preference screen but it wasn't successful</p>
  
  <p>FILE: "preference.xml"</p>
  
  <pre><code>PreferenceScreen&gt;
  
    blah... blah...
  
      &lt;PreferenceScreen&gt;
  
           &lt;ListPreference
              android:id="@+id/pref_key_myNotification_time"
              android:key="@string/pref_key_myNotificationTime"
              android:title="@string/choose_time_hour_title"
              android:defaultValue="24 Hours"
              android:entries="@array/notify_hour"
              android:entryValues="@array/notify_hourValues"
             android:layout="@layout/my_notifications_layout"/&gt;
  
      &lt;/PreferenceScreen&gt;
  
   &lt;/PreferenceScreen&gt;
  </code></pre>
  
  <p>FILE: "my_notification_layout.xml"   </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent"&gt;
  
  
    &lt;LinearLayout style="@style/myLayoutStyle"
                  android:theme="@style/MyAppTheme"&gt;
  
      &lt;TextView style="@style/myPrefStyle"
                android:text="Pick Notification Hours"/&gt;
  
      &lt;TextView android:id="@+id/notifyMe_chooseTime_textView"
                android:layout_height="wrap_content"
                android:layout_width="fill_parent"
                android:text="24 Hours"/&gt;
  
    &lt;/LinearLayout&gt;
  
    &lt;View style="@style/PrefDivider"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Now in my "preference_frag.java"  I tried to access "notifyMe_chooseTime_textView" but failed!!</p>
  
  <pre><code>@Override
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
    {
  /*  This doesn’t seem to be working!! */
  if (pref.getKey().equals(“key_notifyMeChooseTime”))
        {
          TextView tvHours = (TextView) getView().findViewById(“notifyMe_chooseTime_textView”);
          tvHours.setText(pref.getEntry().toString());
  }
    }
  </code></pre>
  
  <p>I'd greatly appreciate if anyone of you can find a solution for it!
  Thanks</p>