Android Open Source - Weather G P S List Adapter






From Project

Back to project page Weather.

License

The source code is released under:

GNU General Public License

If you think the Android project Weather listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.imlongluo.weather.location;
/*from www.  ja  va  2  s .co  m*/
import com.imlongluo.weather.R;

import android.content.Context;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

/** 
 * 
 * @author longluo 
 * ?????????GPS??????????????
 */
public class GPSListAdapter extends BaseAdapter {
  /**
   * ????????????????????
   */
  private Context context;
  
  /**
   * ???????????????????????GPS????????
   * @param context
   */
  public GPSListAdapter(Context context) {
    this.context = context;
  }
  
  /**
   * ???????????????????
   * @return ?????
   */
  @Override
  public int getCount() {
    return 1;
  }

  /**
   * ??????????????
   * @param position ????????
   * @return ????
   */
  @Override
  public Object getItem(int position) {
    //?????????????
    Resources resource = context.getResources();
    return resource.getString(R.string.locale_city);
  }

  /**
   * ???????????Id
   * @see android.widget.Adapter#getItemId(int)
   */
  @Override
  public long getItemId(int position) {
    return 0;
  }

  /**
   * ???????
   */
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    if(convertView == null) {
      LayoutInflater layout=LayoutInflater.from(context);
      convertView = layout.inflate(R.layout.gps, null);
    }
    return convertView;
  }

}




Java Source Code List

.WebAccessTools.java
com.imlongluo.weather.app.MainActivity.java
com.imlongluo.weather.app.SetCityActivity.java
com.imlongluo.weather.app.UpdateWidgetService.java
com.imlongluo.weather.app.WeatherWidget.java
com.imlongluo.weather.db.DBHelper.java
com.imlongluo.weather.location.GPSListAdapter.java
com.imlongluo.weather.location.MyListAdapter.java
com.imlongluo.weather.utils.LocationXMLParser.java
com.imlongluo.weather.utils.WeaterInfoParser.java