Пример #1
0
        public void handleMessage(android.os.Message msg) {
          if (msg.what == 0) {
            mSMenuItem.expandActionView();
            ViewUtils.showKeybord(mSEditText, false);
            clearSearchFocus();
            getSherlockActivity().getSupportActionBar().setIcon(R.drawable.ic_logo);

            mSearchView.setOnSuggestionListener(
                new OnSuggestionListener() {

                  @Override
                  public boolean onSuggestionSelect(int position) {
                    // TODO Auto-generated method stub
                    return false;
                  }

                  @Override
                  public boolean onSuggestionClick(int position) {
                    if (mHistoryAdapter != null) {
                      Cursor s = (Cursor) mHistoryAdapter.getItem(position);
                      if (s.getString(1).equals(HistoryTask.SpecialRow)) {
                        clearHistory();
                      } else {
                        String jjdm = s.getString(2);
                        FundUtils.launchFundDetails(getSherlockActivity(), jjdm, 0, 0);
                        Analytics.onEvent(
                            getActivity(), Analytics.VIEW_FUND_DETAIL, Analytics.KEY_FROM, "历史记录");
                      }
                    }
                    return true;
                  }
                });

            mSMenuItem.setOnActionExpandListener(
                new OnActionExpandListener() {

                  @Override
                  public boolean onMenuItemActionExpand(MenuItem item) {
                    // TODO Auto-generated method stub
                    return false;
                  }

                  @Override
                  public boolean onMenuItemActionCollapse(MenuItem item) {
                    // TODO Auto-generated method stub
                    getActivity().finish();
                    return false;
                  }
                });
          }
        };
Пример #2
0
 @Override
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   ViewUtils.showKeybord(view, false);
   ((AtyMain) getSherlockActivity()).onItemClick(parent, view, position, id);
   mAct.setText(null);
 }