title: how to refresh listview every 5 second help me
body: <p>below is my code i want a every 5 second listview wil refresh with new values what do i do please check my code i just follow this simple tutorial <a href="http://www.mkyong.com/android/android-listview-example/" rel="nofollow">http://www.mkyong.com/android/android-listview-example/</a>  now i want to update every 5 second when i  run this code app crash due to  may b notify inside runable tell me why?</p>
  
  <pre><code>public class ListMobileActivity extends ListActivity {
  
      Handler mHandler;
      static int n = 4;
      private static String[] MOBILE_OS = new String[n];
  
      MobileArrayAdapter setListAdapter ;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          MOBILE_OS[0] = "Android1";
          MOBILE_OS[1] = "iOS1";
          MOBILE_OS[2] = "WindowsMobile1";
          MOBILE_OS[3] = "Blackberry1";
  
          this.mHandler = new Handler();
  
          this.mHandler.postDelayed(m_Runnable,5000);
          setListAdapter(new MobileArrayAdapter(this, MOBILE_OS));
      }
  
      private final Runnable m_Runnable = new Runnable()
      {
          public void run()
  
          {
              MOBILE_OS[0] = "hello1";
              MOBILE_OS[1] = "hello2";
              MOBILE_OS[2] = "hllo3";
              MOBILE_OS[3] = "hello4";
              Toast.makeText(ListMobileActivity.this, "in 
                      runnable",Toast.LENGTH_SHORT).show();
                      setListAdapter.notifyDataSetChanged();
              ListMobileActivity.this.mHandler.postDelayed(m_Runnable, 5000);
          }
      };//runnable
  
  }
  
  private final Context context;
  private final String[] values;
  
      public MobileArrayAdapter(Context context, String[] values) {
          super(context, R.layout.list_mobile, values);
          this.context = context;
          this.values = values;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          LayoutInflater inflater = (LayoutInflater) context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          View rowView = inflater.inflate(R.layout.list_mobile, parent, false);
          TextView textView = (TextView) rowView.findViewById(R.id.label);
          ImageView imageView = (ImageView) rowView.findViewById(R.id.logo);
          textView.setText(values[position]);
  
          // Change icon based on name
          String s = values[position];
  
          System.out.println(s);
  
          return rowView;
      }
  }
  </code></pre>