示例#1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);

    ListView listViewAll;
    super.onCreate(savedInstanceState);
    setContentView(R.layout.more);

    SysApplication.getInstance().addActivity(this);

    Goods[] goods = consumerdata.viewScheduled(Consumer.getClientAccount());
    length = goods.length;
    BOYTYPE = new String[length];
    goodsid = new int[length];
    for (int i = 0; i < BOYTYPE.length; i++) {

      BOYTYPE[i] = goods[i].getGoodsName();
      goodsid[i] = Integer.parseInt(goods[i].getGoodsId());
    }

    listViewAll = (ListView) findViewById(android.R.id.list);
    setListAdapter(
        new SimpleAdapter(
            Reserve.this,
            getDate(),
            R.layout.common_listview_text,
            new String[] {"img", "text", "img_pre"},
            new int[] {R.id.img, R.id.text, R.id.img_pre}));
    listViewAll.setOnItemClickListener(this);

    LinearLayout menu1 = (LinearLayout) findViewById(R.id.menu1);
    menu1.setOnClickListener(menu);
    LinearLayout menu2 = (LinearLayout) findViewById(R.id.menu2);
    menu2.setOnClickListener(menu);
    LinearLayout menu3 = (LinearLayout) findViewById(R.id.menu3);
    menu3.setOnClickListener(menu);
    LinearLayout menu4 = (LinearLayout) findViewById(R.id.menu4);
    menu4.setOnClickListener(menu);
    LinearLayout menu5 = (LinearLayout) findViewById(R.id.menu5);
    menu5.setOnClickListener(menu);
  }
示例#2
0
  public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == 1) {
      Intent intent1 = new Intent(Goods_Rank_Show.this, Goods_Rank_Show.class);

      startActivity(intent1);
      finish();
    } else if (item.getItemId() == 2) {
      Intent intent = new Intent(Goods_Rank_Show.this, ActivityShow.class);
      startActivity(intent);
    } else if (item.getItemId() == 3) {
      account = Consumer.getClientAccount();
      if (account != null) {
        consumerdata.exit(account);
        SysApplication.getInstance().exit();
      } else {
        SysApplication.getInstance().exit();
      }
    }

    return true;
  }