예제 #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);
 }