Java 8 IllegalStateException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 IllegalStateException class.

This code example shows how to use the following methods:setProjection, setSelection, setSortOrder, setUri
        mUnknownNameText = context.getText(android.R.string.unknownName);
    } 
 
    @Override 
    public void configureLoader(CursorLoader loader, long directoryId) {
        loader.setUri(ContactMethods.CONTENT_URI);
        loader.setProjection(POSTALS_PROJECTION);
        loader.setSortOrder(People.DISPLAY_NAME);
        loader.setSelection(ContactMethods.KIND + "=" + android.provider.Contacts.KIND_POSTAL);
    } 
 
    @Override 
    public String getContactDisplayName(int position) {
        return ((Cursor)getItem(position)).getString(POSTAL_DISPLAY_NAME_COLUMN_INDEX);
    } 
 
    public Uri getContactMethodUri(int position) {
        Cursor cursor = ((Cursor)getItem(position));
        long id = cursor.getLong(POSTAL_ID_COLUMN_INDEX);
        return ContentUris.withAppendedId(ContactMethods.CONTENT_URI, id);
8
CodeRank
This code example shows how to use the following methods:
        } 
    } 
 
    public static long getUniqueID(String identifier) {
        if(_packageNameHash == 0) {
            throw new IllegalStateException( ID.class.getName() + " is not initialized" );
        } 
        return (_packageNameHash & 0x00000000FFFFFFFFL) | ( (long) identifier.hashCode() << 32 );
    } 
     
    public static long getUniqueID() { 
        if(_packageNameHash == 0) {
            throw new IllegalStateException( ID.class.getName() + " is not initialized" );
        } 
        return _packageNameHash;
    } 
} 
5
CodeRank
This code example shows how to use the following methods:setProjection, setSortOrder, setUri
        mUnknownNameText = context.getText(android.R.string.unknownName);
    } 
 
    @Override 
    public void configureLoader(CursorLoader loader, long directoryId) {
        loader.setUri(Phones.CONTENT_URI);
        loader.setProjection(PHONES_PROJECTION);
        loader.setSortOrder(Phones.DISPLAY_NAME);
    } 
 
    @Override 
    public String getContactDisplayName(int position) {
        return ((Cursor)getItem(position)).getString(PHONE_DISPLAY_NAME_COLUMN_INDEX);
    } 
 
    public Uri getPhoneUri(int position) {
        Cursor cursor = ((Cursor)getItem(position));
        long id = cursor.getLong(PHONE_ID_COLUMN_INDEX);
        return ContentUris.withAppendedId(Phones.CONTENT_URI, id);
    } 
7
CodeRank
This code example shows how to use the following methods:setProjection, setSortOrder, setUri
        mUnknownNameText = context.getText(android.R.string.unknownName);
    } 
 
    @Override 
    public void configureLoader(CursorLoader loader, long directoryId) {
        loader.setUri(People.CONTENT_URI);
        loader.setProjection(PEOPLE_PROJECTION);
        loader.setSortOrder(People.DISPLAY_NAME);
    } 
 
    @Override 
    public String getContactDisplayName(int position) {
        return ((Cursor)getItem(position)).getString(PERSON_DISPLAY_NAME_COLUMN_INDEX);
    } 
 
    public Uri getPersonUri(int position) {
        Cursor cursor = ((Cursor)getItem(position));
        long personId = cursor.getLong(PERSON_ID_COLUMN_INDEX);
        return ContentUris.withAppendedId(People.CONTENT_URI, personId);
    } 
7
CodeRank
This code example shows how to use the following methods:
 
    getLoaderManager().initLoader(0, null, this);
  } 
 
  public Loader<Cursor> onCreateLoader(int loaderId, Bundle args) {
    return(new CursorLoader(this, CalendarContract.Events.CONTENT_URI,
                            PROJECTION, null, null,
                            CalendarContract.Events.DTSTART));
  } 
 
  public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    adapter.swapCursor(cursor);
  } 
 
  public void onLoaderReset(Loader<Cursor> loader) {
    adapter.swapCursor(null);
  } 
 
  @Override 
  public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
7
CodeRank
This code example shows how to use the following methods:changeCursor, getCount
        if (mCursorAdapter == null) {
            mCursorAdapter = newAdapter();
 
            setListAdapter(mCursorAdapter);
        } else { 
            mCursorAdapter.changeCursor(mCursor);
        } 
 
        if (mInitialSelection >=0 && mInitialSelection < mCursorAdapter.getCount()) {
            setSelection(mInitialSelection);
            getListView().setFocusableInTouchMode(true);
            boolean gotfocus = getListView().requestFocus();
        } 
    } 
 
    protected CursorAdapter newAdapter() {
        return new SimpleCursorAdapter(this,
                    android.R.layout.simple_list_item_2,
                    mCursor, COLUMN_NAMES, VIEW_NAMES);
    } 
6
CodeRank
This code example shows how to use the following methods:
    setListAdapter(adapter);
    getLoaderManager().initLoader(0, null, this);
  } 
 
  public Loader<Cursor> onCreateLoader(int loaderId, Bundle args) {
    return(new CursorLoader(this, CONTENT_URI, PROJECTION, null, null,
                            CallLog.Calls.DATE+" DESC"));
  } 
 
  public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    adapter.swapCursor(cursor);
  } 
 
  public void onLoaderReset(Loader<Cursor> loader) {
    adapter.swapCursor(null);
  } 
 
  @Override 
  public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
    long time=0;
7
CodeRank
This code example shows how to use the following methods:changeCursor
    } 
  } 
 
  @Implementation 
  public void changeCursor(Cursor c) {
    realSimpleCursorAdapter.changeCursor(c);
    // rescan columns in case cursor layout is different 
    findColumns(mOriginalFrom);
  } 
 
  /** 
   * Change the cursor and change the column-to-view mappings at the same time. 
   * 
   * @param c The database cursor.  Can be null if the cursor is not available yet. 
   * @param from A list of column names representing the data to bind to the UI.  Can be null 
   *            if the cursor is not available yet. 
   * @param to The views that should display column in the "from" parameter. 
   *            These should all be TextViews. The first N views in this list 
   *            are given the values of the first N columns in the from 
   *            parameter.  Can be null if the cursor is not available yet. 
6
CodeRank
This code example shows how to use the following methods:changeCursor, getCount
        if (mCursorAdapter == null) {
            mCursorAdapter = newAdapter();
 
            setListAdapter(mCursorAdapter);
        } else { 
            mCursorAdapter.changeCursor(mCursor);
        } 
 
        if (mInitialSelection >=0 && mInitialSelection < mCursorAdapter.getCount()) {
            setSelection(mInitialSelection);
            getListView().setFocusableInTouchMode(true);
            boolean gotfocus = getListView().requestFocus();
        } 
    } 
 
    protected CursorAdapter newAdapter() {
        return new SimpleCursorAdapter(this,
                    android.R.layout.simple_list_item_2,
                    mCursor, COLUMN_NAMES, VIEW_NAMES);
    } 
6
CodeRank
This code example shows how to use the following methods:changeCursor
        } 
    } 
 
    @Implementation 
    public void changeCursor(Cursor c) {
        realSimpleCursorAdapter.changeCursor(c);
        // rescan columns in case cursor layout is different 
        findColumns(mOriginalFrom);
    } 
 
    /** 
     * Change the cursor and change the column-to-view mappings at the same time. 
     * 
     * @param c The database cursor.  Can be null if the cursor is not available yet. 
     * @param from A list of column names representing the data to bind to the UI.  Can be null 
     *            if the cursor is not available yet. 
     * @param to The views that should display column in the "from" parameter. 
     *            These should all be TextViews. The first N views in this list 
     *            are given the values of the first N columns in the from 
     *            parameter.  Can be null if the cursor is not available yet. 
6
CodeRank

Related Java 8 IllegalStateException Questions & Answers:

Other Java 8 IllegalStateException Examples

24:				e.printStackTrace();
25:			} catch (IllegalStateException e) {
26:				e.printStackTrace();
27:			} catch (IOException e) {
28:				e.printStackTrace();

Read More

254:		/**
255:		 * Receiving song index from playlist view
256:		 * and play the song
257:		 * */
258:		@Override

Read More

See Code Examples for Java 8 IllegalStateException Methods: