Android Open Source - BikeStation Bikes Activity






From Project

Back to project page BikeStation.

License

The source code is released under:

GNU General Public License

If you think the Android project BikeStation 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 com.bikestation.app.activity;
/*  www .  ja  v a 2 s  . co  m*/
import android.bluetooth.BluetoothDevice;
import android.content.SharedPreferences;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.bikestation.app.Lock;
import com.bikestation.app.adapter.BikesAdapter;
import com.bikestation.app.adapter.DeviceAdapter;
import com.kdravolin.smartlock.app.R;

import butterknife.ButterKnife;
import butterknife.InjectView;

public class BikesActivity extends ActionBarActivity {

    @InjectView(R.id.lv_bikes) ListView lvBikes;
    BikesAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bikes);
        ButterKnife.inject(this);
        adapter = new BikesAdapter(this);
        lvBikes.setAdapter(adapter);
        lvBikes.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                BikesAdapter adapter = (BikesAdapter) parent.getAdapter();
                String bikeId = (String) adapter.getItem(position);

                Lock.GetBikeTask task = new Lock.GetBikeTask(BikesActivity.this, bikeId);
                task.execute();
            }
        });

        Lock.BikesTask task = new Lock.BikesTask(adapter);
        task.execute();
    }

}




Java Source Code List

com.bikestation.app.BluetoothConnector.java
com.bikestation.app.BluetoothWorker.java
com.bikestation.app.ExtApp.java
com.bikestation.app.History.java
com.bikestation.app.Lock.java
com.bikestation.app.User.java
com.bikestation.app.account.AccountAuthenticator.java
com.bikestation.app.account.AuthenticationService.java
com.bikestation.app.activity.AccountActivity.java
com.bikestation.app.activity.BikesActivity.java
com.bikestation.app.activity.DeviceActivity.java
com.bikestation.app.activity.TimeActivity.java
com.bikestation.app.adapter.BikesAdapter.java
com.bikestation.app.adapter.DeviceAdapter.java