Android Open Source - dbpendler Connection Overview Adapter

From Project

Back to project page dbpendler.


The source code is released under:

Copyright 2013 Marcus Schiesser Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Softw...

If you think the Android project dbpendler listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.marcusschiesser.dbpendler.client.adapters;
/*  w w w.  j  a  v  a2 s  . co  m*/

import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.widget.ResourceCursorAdapter;
import android.widget.TextView;
import de.marcusschiesser.dbpendler.client.model.ConnectionsDb;
import de.marcusschiesser.dbpendler.common.vo.ConnectionVO;

public class ConnectionOverviewAdapter extends ResourceCursorAdapter {
  public ConnectionOverviewAdapter(Context context, int layout, Cursor c) {
    super(context, layout, c);

  public void bindView(View view, Context context, Cursor cursor) {
    TextView textView = (TextView) view;
    ConnectionVO connectionVO = ConnectionsDb.createConnectionFromCursor(cursor);
    String formated = formatConnection(connectionVO);

  public static String formatConnection(ConnectionVO connectionVO) {
    String formated = String.format("%s %tR - %s %tR", connectionVO.getStart().getValue(), connectionVO.getStartTime(), connectionVO.getDestination().getValue(), connectionVO.getDestinationTime());
    return formated;

Java Source Code List