@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (!Intent.ACTION_VIEW.equals(getIntent().getAction())
        && !Intent.ACTION_PICK.equals(getIntent().getAction())) {
      LOG.error(
          "Unsupported action.  Expected [{}] or [{}] but received [{}].",
          new Object[] {Intent.ACTION_VIEW, Intent.ACTION_PICK, getIntent().getAction()});

      onTerminalError();
    } else {

      Cursor splitMarkerSetCursor =
          managedQuery(TrackLoggerData.SplitMarkerSet.CONTENT_URI, null, null, null, null);

      SimpleCursorAdapter adapter =
          new SimpleCursorAdapter(
              this,
              R.layout.split_marker_set_list_item,
              splitMarkerSetCursor,
              new String[] {
                TrackLoggerData.SplitMarkerSet._ID, TrackLoggerData.SplitMarkerSet.COLUMN_NAME_NAME
              },
              new int[] {R.id.splitMarkerSetId, R.id.splitMarkerSetName});

      setContentView(R.layout.split_marker_set_list);
      setListAdapter(adapter);

      getListView().setOnCreateContextMenuListener(this);
    }
  }
 @Override
 protected void onResume() {
   super.onResume();
   back_btn.setVisibility(ImageButton.VISIBLE);
   TextView top_title_tv = (TextView) this.getParent().findViewById(R.id.top_title);
   top_title_tv.setText(R.string.menu_local_music);
   adapter.notifyDataSetChanged();
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.local_audio_list);
   initPopupMenu();
   initButtons();
   initListAdapter();
 }
  @Override
  protected void onDestroy() {
    if (contextMenuItemConfirmDialog != null) {
      contextMenuItemConfirmDialog.dismiss();
    }

    super.onDestroy();
  }
 // Called on the UIThread when Nuxeo data has been retrieved
 @Override
 protected void onNuxeoDataRetrieved(Object data) {
   super.onNuxeoDataRetrieved(data);
   if (data != null) {
     // get the DocumentList from the async call result
     documentsList = (LazyUpdatableDocumentsList) data;
     displayDocumentList(listView, documentsList);
   }
 }
 @Override
 public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
   if (v.getId() == listView.getId()) {
     AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
     Document doc = documentsList.getDocument(info.position);
     menu.setHeaderTitle(doc.getTitle());
     populateContextMenu(doc, menu);
   }
   super.onCreateContextMenu(menu, v, menuInfo);
 }
  @Override
  protected void onResume() {
    super.onResume();

    if (Intent.ACTION_PICK.equals(getIntent().getAction())) {
      Toast.makeText(
              getApplicationContext(),
              getString(R.string.split_marker_set_list_pick_instructions),
              Toast.LENGTH_LONG)
          .show();
    }
  }
Exemplo n.º 8
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(getString(R.string.ShoppingListTitle));
    setContentView(R.layout.activity_shopping_list);
    table = ShoppingList.TABLE_NAME;

    setupAdapter();
    setupSearchView();
    mSearchView.setQueryHint(getString(R.string.add_ing_to_shopping));
    lView = (ListView) findViewById(R.id.shop_list);
    lView.setVisibility(View.INVISIBLE);
  }
Exemplo n.º 9
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.event_list);

    ListCreator<?> lc =
        new ListCreator<News>(this, R.id.event_list, R.id.event_list_progress_bar) {

          @Override
          protected News[] getObjects() {
            return getDataHandler().getNews();
          }
        };
    lc.execute();
  }
Exemplo n.º 10
0
  @Override
  protected void onResume() {
    super.onResume();

    boolean registeredUserChanged =
        mFeed.getUserAcquiredFor() != null
            && (!mFeed.getUserAcquiredFor().equals(Settings.getUserName(this)));

    // We want to reload the feed if a new user logged in
    if (HNCredentials.isInvalidated() || registeredUserChanged) {
      showFeed(new HNFeed(new ArrayList<HNPost>(), null, ""));
      startFeedLoading();
    }

    // refresh if font size changed
    if (refreshFontSizes()) mPostsListAdapter.notifyDataSetChanged();

    // Ramesh kumar coding part for change background color using radio button
    if (refreshBackgroundColor()) mPostsListAdapter.notifyDataSetChanged();

    // ------------- kevin's codes. refresh the setup when changing the setting -----------------
    if (refreshHTMLContent()) {

      if (mCurrentHTMLContent.equals("display")) {

        new Thread(getURLContent_Thread).start();
      } else {
        List<HNPost> mPosts = mFeed.getPosts();
        for (int i = 0; i < mPosts.size(); i++) {

          mPosts.get(i).setContent("");
        }
        showFeed(mFeed);
      }
    }
    // restore vertical scrolling position if applicable
    if (mListState != null) mPostsList.onRestoreInstanceState(mListState);

    mListState = null;
  }
Exemplo n.º 11
0
 @Override
 protected void onSaveInstanceState(Bundle state) {
   super.onSaveInstanceState(state);
   mListState = mPostsList.onSaveInstanceState();
   state.putParcelable(LIST_STATE, mListState);
 }
Exemplo n.º 12
0
 @Override
 protected void onRestoreInstanceState(Bundle state) {
   super.onRestoreInstanceState(state);
   mListState = state.getParcelable(LIST_STATE);
 }
 @Override
 protected void adjustLayout() {
   setContentView(R.layout.categories);
   super.adjustLayout();
   mListView.setOnItemClickListener(new ListItemClickListener());
 }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   LoadTask mTask = new LoadTask(this, mHandler, Constants.categoryIndex, null);
   mTask.execute();
 }