Skip to content

Instantly share code, notes, and snippets.

@thevery
Created January 30, 2011 00:23
Show Gist options
  • Save thevery/802366 to your computer and use it in GitHub Desktop.
Save thevery/802366 to your computer and use it in GitHub Desktop.
package roboguice.astroboy;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import roboguice.inject.InjectView;
import java.util.List;
/**
* @author Ildar Karimov
*/
public class RoboBaseAdapterButton extends RoboBaseAdapter {
@InjectView(R.id.buton)
private Button button;
private List<String> items;
public RoboBaseAdapterButton(Context context, int layoutId, List<String> items) {
super(context, layoutId);
this.items = items;
}
public int getCount() {
return items.size();
}
public String getItem(int position) {
return items.get(position);
}
public long getItemId(int i) {
return i;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
button.setText(getItem(position));
return view;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment