Ejemplo n.º 1
0
  /**
   * Send message back to handler which is initialized in a activity
   *
   * @param what Message integer you want to send
   */
  private void sendMessageToHandler(Integer what) {
    Message msg = Message.obtain();
    msg.what = what;

    try {
      mMessenger.send(msg);
    } catch (RemoteException e) {
      Log.w(Constants.TAG, "Exception sending message, Is handler present?", e);
    } catch (NullPointerException e) {
      Log.w(Constants.TAG, "Messenger is null!", e);
    }
  }
Ejemplo n.º 2
0
  public boolean moveCursor(int position) {
    if (position >= getItemCount() || position < -1) {
      Log.w(TAG, "Position: %d is invalid for this data set!");
      return false;
    }

    if (!mDataValid) {
      Log.d(TAG, "Attempt to move cursor over invalid data set!");
    }

    return mCursor.moveToPosition(position);
  }