title: Update TextView on timer tick in fragment
body: <p>I have got trouble to update my TextView in tab fragment. I want to setText on TextView on every second with global variable data. This works fine in activity, but not in fragment. Error is: <strong>textView2 cannot be resolved.</strong> If there is better method for updating this, or is this isn't good, please tell me.   </p>
  
  <pre><code>public class FragmentA extends Fragment {
  
      //timer
          private TimerTask mTimerTask;
          private Timer timer = new Timer();  
  
          private final Handler timerHandler = new Handler();
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          View myFragmentView = inflater.inflate(R.layout.fragment_a, container, false);
  
  
          //TextView for Device name
          TextView textView3 = (TextView)myFragmentView.findViewById(R.id.TextView3);
          //TextView for Serial number
          TextView textView5 = (TextView)myFragmentView.findViewById(R.id.TextView5);
          //TextView for Software version
          TextView textView7 = (TextView)myFragmentView.findViewById(R.id.TextView7);
  
          onTimerTick();
          timer.schedule(mTimerTask, 10, 1000); 
  
          return myFragmentView;
      }
  
          //timer tick on every 1 s 
          public void onTimerTick() {
              mTimerTask = new TimerTask() {
                  //this method is called every 1ms
                  public void run() {                 
                       timerHandler.post(new Runnable() {
                           public void run() {  
                              //update textView
                              //ERROR:textView2 cannot be resolved
                                  textView2.setText(m_info.deviceName);
                              Log.d("tag", "Hello from timer fragment");
                           }
                       });                    
                  }};      
          }             
  }
  </code></pre>