Java Code Examples for android.database.Cursor.getExtras()

The following are Jave code examples for showing how to use getExtras() of the android.database.Cursor class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: CSipSimple   File: SuggestionsAdapter.java   Source Code and License Vote up 6 votes
private void updateSpinnerState(Cursor cursor) {
    Bundle extras = cursor != null ? cursor.getExtras() : null;
    if (DBG) {
        Log.d(LOG_TAG, "updateSpinnerState - extra = "
                + (extras != null
                ? extras.getBoolean(SearchManager.CURSOR_EXTRA_KEY_IN_PROGRESS)
                : null));
    }
    // Check if the Cursor indicates that the query is not complete and show the spinner
    if (extras != null
            && extras.getBoolean(SearchManager.CURSOR_EXTRA_KEY_IN_PROGRESS)) {
        // mSearchView.getWindow().getDecorView().post(mStartSpinnerRunnable); // TODO:
        return;
    }
    // If cursor is null or is done, stop the spinner
    // mSearchView.getWindow().getDecorView().post(mStopSpinnerRunnable); // TODO:
}
 
Example 2
Project: prada   File: UploadAgentHelper.java   Source Code and License Vote up 6 votes
public boolean isUserAgreeUpload(){
    Cursor cursor = null;
    boolean isAgreeUpload = false;
    try {
      cursor = getContentResolver().query(CONTENT_URI, null, null, null, null);
      cursor.moveToNext();
      Bundle bundle = cursor.getExtras();
      if (bundle != null) {
          isAgreeUpload = bundle.getBoolean("service_on");
      }

    } catch(Exception ex){
        Log.i(TAG, ex.toString());
    }finally{
        if (cursor != null) {
          cursor.close();
        }

    }
    return isAgreeUpload;
}
 
Example 3
Project: prada   File: UploadAgentHelper.java   Source Code and License Vote up 6 votes
public String getAPRServerURL(){
    Cursor cursor = null;
    String ServerURL = Util.APR_SERVER_URL;
    try {
      cursor = getContentResolver().query(CONTENT_URI, null, null, null, null);
      cursor.moveToNext();
      Bundle bundle = cursor.getExtras();
      if (bundle != null) {
          if (bundle.getString("aprServerUrl") != null &&
                  !"null".equals(bundle.getString("aprServerUrl"))) {
            ServerURL = bundle.getString("aprServerUrl");
          }
      }

    } catch(Exception ex){
        Log.i(TAG, ex.toString());
    }finally{
        if (cursor != null) {
          cursor.close();
        }

    }
    return ServerURL;
}
 
Example 4
Project: prada   File: UploadAgentHelper.java   Source Code and License Vote up 6 votes
public String getDUTInfoString(){
    Cursor cursor = null;
    String dutInfoString = "";
    try {
      cursor = getContentResolver().query(CONTENT_DUTINFO_URI, null, null, null, null);
      cursor.moveToNext();
      Bundle bundle = cursor.getExtras();
      if (bundle != null) {
          dutInfoString = bundle.getString("stringDUT");
      }

    } catch(Exception ex){
        Log.i(TAG, ex.toString());
    }finally{
        if (cursor != null) {
          cursor.close();
        }

    }
    return dutInfoString;
}
 
Example 5
Project: android-ContentProviderPaging   File: ImageClientFragment.java   Source Code and License Vote up 5 votes
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    Bundle extras = cursor.getExtras();
    int totalSize = extras.getInt(ContentResolver.EXTRA_TOTAL_SIZE);
    mAdapter.setTotalSize(totalSize);
    int beforeCount = mAdapter.getFetchedItemCount();
    while (cursor.moveToNext()) {
        String displayName = cursor.getString(cursor.getColumnIndex(
                ImageContract.Columns.DISPLAY_NAME));
        String absolutePath = cursor.getString(cursor.getColumnIndex(
                ImageContract.Columns.ABSOLUTE_PATH));

        ImageAdapter.ImageDocument imageDocument = new ImageAdapter.ImageDocument();
        imageDocument.mAbsolutePath = absolutePath;
        imageDocument.mDisplayName = displayName;
        mAdapter.add(imageDocument);
    }
    int cursorCount = cursor.getCount();
    if (cursorCount == 0) {
        return;
    }
    Activity activity = ImageClientFragment.this.getActivity();
    mAdapter.notifyItemRangeChanged(beforeCount, cursorCount);
    int offsetSnapShot = mOffset.get();
    String message = activity.getResources()
            .getString(R.string.fetched_images_out_of, offsetSnapShot + 1,
                    offsetSnapShot + cursorCount, totalSize);
    mOffset.addAndGet(cursorCount);
    Toast.makeText(activity, message, Toast.LENGTH_LONG).show();
}
 
Example 6
Project: springreplugin   File: BinderCursor.java   Source Code and License Vote up 5 votes
public static final IBinder getBinder(Cursor cursor) {
    Bundle extras = cursor.getExtras();
    extras.setClassLoader(BinderCursor.class.getClassLoader());
    BinderParcelable w = (BinderParcelable) extras.getParcelable(BINDER_KEY);
    if (LOG) {
        LogDebug.d(PLUGIN_TAG, "get binder = " + w.mBinder);
    }
    return w.mBinder;
}
 
Example 7
Project: springreplugin   File: ServiceChannelCursor.java   Source Code and License Vote up 4 votes
static final IBinder getBinder(Cursor cursor) {
    Bundle bundle = cursor.getExtras();
    bundle.setClassLoader(ParcelBinder.class.getClassLoader());
    ParcelBinder parcelBinder = bundle.getParcelable(SERVER_CHANNEL_BUNDLE_KEY);
    return parcelBinder.getIbinder();
}
 
Example 8
Project: IPCServiceManager   File: BinderQuerier.java   Source Code and License Vote up 4 votes
static final IBinder query(Cursor cursor) {
	Bundle bundle = cursor.getExtras();
	bundle.setClassLoader(BinderParcel.class.getClassLoader());
	BinderParcel parcelBinder = bundle.getParcelable(BinderCusrsor.BINDER_CURSOR);
	return parcelBinder.getIbinder();
}
 
Example 9
Project: boohee_v5.6   File: SuggestionsAdapter.java   Source Code and License Vote up 4 votes
private void updateSpinnerState(Cursor cursor) {
    Bundle extras = cursor != null ? cursor.getExtras() : null;
    if (extras != null && !extras.getBoolean("in_progress")) {
    }
}