コード例 #1
0
 @Override
 public void bindView(View view, Context context, Cursor cursor) {
   super.bindView(view, context, cursor);
   TextView setup = (TextView) view.findViewById(R.id.text3);
   TextView reply = (TextView) view.findViewById(R.id.text4);
   locationCursor.moveToPosition(cursor.getPosition());
   long rt = locationCursor.getLong(1);
   if (rt > 0) {
     Calendar cal = Calendar.getInstance();
     cal.setTimeInMillis(rt);
     DateFormat sdf = SimpleDateFormat.getDateTimeInstance();
     setup.setText("requested on: " + sdf.format(cal.getTime()));
   } else {
     setup.setText("requested on: <not available>");
   }
   rt = locationCursor.getLong(2);
   if (rt > 0) {
     Calendar cal = Calendar.getInstance();
     cal.setTimeInMillis(rt);
     DateFormat sdf = SimpleDateFormat.getDateTimeInstance();
     reply.setText("updated on:" + sdf.format(cal.getTime()));
     ((ImageView) view.findViewById(R.id.status))
         .setImageResource(android.R.drawable.presence_online);
   } else {
     reply.setText("updated on: <not available>");
   }
 }
コード例 #2
0
  @Override
  public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    // getting a null pointer exception here

    Log.d(TAG, "Content loaded: " + cursor.getCount());
    listAdapter.swapCursor(cursor);
  }
コード例 #3
0
 void showDetails(int pos) {
   Cursor c = (Cursor) listAdapter.getItem(pos);
   showDetails(
       ContactContract.OBJECT_CONTACT_URI
           .buildUpon()
           .appendPath(c.getString(c.getColumnIndex(ContactContract.Columns._ID)))
           .build());
 }
コード例 #4
0
  void resolveConflict(int pos) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG, "resolve conflicts");
    }

    Cursor c = (Cursor) listAdapter.getItem(pos);

    int di = c.getColumnIndex(WebData.Object.WD_DATA_ID);
    String dataID = c.getString(di);
    resolveConflict(dataID);
  }
コード例 #5
0
    @Override
    public void bindView(View view, Context context, final Cursor cursor) {
      boolean inConflict = WebData.Object.inConflict(cursor);

      if (inConflict) {
        view.setBackgroundResource(R.color.conflicted);
      } else {
        view.setBackgroundResource(android.R.color.black);
      }

      super.bindView(view, context, cursor);
    }
コード例 #6
0
 @Override
 public void onLoaderReset(Loader<Cursor> loader) {
   listAdapter.swapCursor(null);
 }