示例#1
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.search_restau_rank);

    initView();
    setListener();

    new AsyncRestauRankTask()
        .execute(String.valueOf(mRestauRequestTimes), String.valueOf(mRestauLimit));

    XidianYaoyaoApplication.getInstance().addActivity(this);
  }
示例#2
0
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.shake_group_dialog);

    mGroupRestau = (RelativeLayout) findViewById(R.id.shake_group_restau);
    mGroupPrice = (RelativeLayout) findViewById(R.id.shake_group_price);
    mGroupNumber = (RelativeLayout) findViewById(R.id.shake_group_number);
    mPriceShow = (TextView) findViewById(R.id.priceShow);
    mNumberShow = (TextView) findViewById(R.id.numberShow);

    preferencesService = new PreferencesService(this);

    if (preferencesService.shakeGroupPrice_getPreferences().equals("")) {
      preferencesService.save_shakeGroupPriceNum(0);
      preferencesService.save_shakeGroupPrice("不限"); // 设定默认值为第一个
    }
    if (preferencesService.shakeNumber_getPreferences().equals("")) {
      preferencesService.save_shakeNumberNum(0);
      preferencesService.save_shakeNumber("2"); // 设定默认值为第一个
    }

    mPriceShow.setText(preferencesService.shakeRestau_getPreferences());
    mPriceShow.setText(preferencesService.shakeGroupPrice_getPreferences());
    mNumberShow.setText(preferencesService.shakeNumber_getPreferences());

    mGroupPrice.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            CheckPriceDialog();
          }
        });
    mGroupNumber.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            CheckNumberDialog();
          }
        });

    mDBallName = DataAllDB.getRestau();
    ArrayAdapter<String> adapter =
        new ArrayAdapter<String>(this, R.layout.widget_search_down, mDBallName);
    mSearchEdit = (AutoCompleteTextView) findViewById(R.id.restauSearch);
    mSearchEdit.setAdapter(adapter);
    mSearchEdit.setText(preferencesService.shakeRestau_getPreferences());

    mSearchEdit.addTextChangedListener(
        new TextWatcher() {
          public void onTextChanged(CharSequence s, int start, int before, int count) {
            // TODO Auto-generated method stub
          }

          public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            // TODO Auto-generated method stub
          }

          public void afterTextChanged(Editable s) {
            if (s.length() != 0) {
              preferencesService.save_shakeRestau(mSearchEdit.getText().toString().trim());
            }
          }
        });

    XidianYaoyaoApplication.getInstance().addActivity(this);
  }