コード例 #1
0
  private void initView() {
    // TODO Auto-generated method stub  sessionId
    mySharedPreferences = getSharedPreferences("Teleshopping", MODE_PRIVATE);
    sessionId = mySharedPreferences.getString("sessionId", "sessionId");
    merchantId = mySharedPreferences.getLong("merchantId", 10000);
    System.out.println("sessionId---" + sessionId + "--id---" + merchantId);
    csz_ll = (LinearLayout) findViewById(R.id.csz_ll);
    csz_ll.setOnClickListener(this);
    dsj_ll = (LinearLayout) findViewById(R.id.dsj_ll);
    dsj_ll.setOnClickListener(this);
    lv = (XListView) findViewById(R.id.lv);
    lv.setPullLoadEnable(true);
    lv.setXListViewListener(this);
    lv.setDivider(null);
    lv.setOnItemClickListener(
        new OnItemClickListener() {

          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            // TODO Auto-generated method stub
            Intent i = new Intent(getApplicationContext(), GoodsDetail.class);
            i.putExtra("goodsInfoId", myList.get(position - 1).getId() + "");
            System.out.println("goodsInfoId" + myList.get(position - 1).getId());
            startActivity(i);
          }
        });

    myAdapter = new MerchantManagerAdapter(MerchantManager.this, myList);
    lv.setAdapter(myAdapter);
  }
コード例 #2
0
 private void initView() {
   titleback_image_back = (ImageView) findViewById(R.id.titleback_image_back);
   search = (ImageView) findViewById(R.id.search);
   order_listview = (XListView) findViewById(R.id.order_listview);
   order_listview.setDivider(null);
   order_listview.setPullLoadEnable(true);
   order_listview.setXListViewListener(this);
   titleback_image_back.setOnClickListener(this);
   search.setOnClickListener(this);
   order_listview.setOnItemClickListener(
       new OnItemClickListener() {
         public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
           index = arg2 - 1;
           Intent intent = new Intent();
           intent.setClass(getApplicationContext(), TodayOederDetailsActivity.class);
           intent.putExtra("merchantOrderId", orderList.get(arg2 - 1).getMerchantOrderId());
           startActivityForResult(intent, 0);
         }
       });
 }