I can\'t start a new activity clicking over an item in my listview. I want that onItemClick
can open the ApkInfoActivity
.. Actually when i click no
Use This for doing your work
list.setOnItemClickListener(new AdapterView.onItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapter, View view, int position, long arg) {
Intent appInfo = new Intent(YourActivity.this, ApkInfoActivity.class);
startActivity(appInfo);
}
});
Use this:
Intent appInfo = new Intent(CurrentActivity.this, ApkInfoActivity.class);
startActivity(appInfo);
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapter, View view, int position, long arg) {
if(position==0){
Intent appInfo = new Intent(SwahiliService.this, DisplayActivity.class);
startActivity(appInfo);
}
if(position==1){
Intent english=new Intent(SwahiliService.this,EnglishService.class);
startActivity(english);
}
if(position==2){
Toast.makeText(getApplicationContext(),"You have selected pst3", Toast.LENGTH_LONG).show();
}
}});
Try changing the visibility from protected
to public
for your method header.
Edit
Now that I look at it, your method header is actually wrong. It should be the following:
public abstract void onItemClick (AdapterView<?> parent, View view, int position, long id)
The variables must be in the same order as they are in the Interface they implement.