コード例 #1
0
  @Override
  protected void postInitUI() {
    super.postInitUI();
    mAdapter = new AlarmListAdapter(this);
    mAdapter.setCache(controller.getCache());
    controller.addObserver(mAdapter);
    mAdapter.setClockAction(controller);
    lvAlarm.setAdapter(mAdapter);
    lvAlarm.setOnItemClickListener(
        new OnItemClickListener() {

          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            Log.d(Clock.TAG, "default click");
            TemporaryData.save(Clock.class.getName(), controller.getCache().read().get(position));
            TemporaryData.save(ClockController.class.getName(), controller);
            AlarmEditActivity.callMe(AlarmListActivity.this);
          }
        });
    lvAlarm.setOnItemLongClickListener(
        new OnItemLongClickListener() {
          @Override
          public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
            showDialog(controller.getCache().read().get(position));
            return true;
          }
        });
    controller.checkDefaultClockPolicy();
  }
コード例 #2
0
  @Override
  protected void postInitUI() {
    super.postInitUI();
    etContent.setOnKeyListener(
        new OnKeyListener() {

          @Override
          public boolean onKey(View v, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_DOWN) {
              uploadFeedBackInfo();
              return true;
            }
            return false;
          }
        });
  }