I have BaseAdapter class for listview , two button is in this listview . When click this button ,i want to that open or closing slinding drawer . Full screen my application picture http://tinypic.com/view.php?pic=wtjg2s&s=8#.VFngCvmsXtt
My baseadapter class
public class SCariList extends BaseAdapter{
NCari cari = new NCari();
Context context;
Activity activity;
private LayoutInflater inflater;
private List<NCari> cariList;
public SCariList(Activity activity , List<NCari> cariler,Context con){
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
cariList = cariler;
context = con;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
View vi = convertView;
if(convertView == null)
// vi = inflater.inflate(R.layout.test_satir, parent,false);
vi = inflater.inflate(R.layout.test_satir, null);
final TextView textViewtest = (TextView) vi.findViewById(R.id.test_satir);
final TextView textView2 = (TextView) vi.findViewById(R.id.test_satir2); //cal???yor
//Bu ikisini kapalt?k
final ImageButton btn_gecmis = (ImageButton) vi.findViewById(R.id.btn_gecmis);
final ImageButton btn_duzenle = (ImageButton) vi.findViewById(R.id.btn_duzenle);
/*Burada bir terslik var*/
final Button btn_gecmis1 = (Button) vi.findViewById(R.id.btn_evrak1);
final Button btn_duzenle1 = (Button) vi.findViewById(R.id.btn_gecmis1);
//Buraya istedi?imiz gibi ekleyebilir.
NCari nCari = cariList.get(position);
/*istedi?imiz de?erlerle set ettik*/
textViewtest.setText(String.valueOf(nCari.getID()));
textView2.setText(nCari.getAd().toString());
/*Butona bas?nca SlidingDrawer cal??mas?
* sdwAlisFatura ad?*/
/*YEN? EVRAK*/
btn_gecmis1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
cari.setCariID(Integer.valueOf(textViewtest.getText().toString()));
cari.setAd(textView2.getText().toString());
Intent intent = new Intent(context, SEvrak.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("Cari", cari);
context.startActivity(intent);
}
});
btn_duzenle1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
// Toast.makeText(context, "Oldu", 10).show();
}
});
return vi;
}
}
and activity classs
public class AlisCari extends Activity {
Context context=this ;
EditText arama;
ListView cariListView;
TextView tvSatir;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.alis_cari);
arama = (EditText) findViewById(R.id.txtAlisFaturaArama);
cariListView = (ListView) findViewById(R.id.lstAlisSiparisCari);
CariVeritaban cariVeritaban = new CariVeritaban(getApplicationContext());
List<NCari> cariler = cariVeritaban.getCariListe();
SCariList sCariList = new SCariList(AlisCari.this, cariler, context);
cariListView.setAdapter(sCariList);
arama.addTextChangedListener(txtizleyici);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…