Anyone know about how to fix my code? in my StudentListView.setOnItemClickListener there is putExtra which is will send the data to ActivityShow.class
StudentListView.setOnItemClickListener(new AdapterView.OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(Activity.this,ActivityShow.class);
// Sending ListView clicked value using intent.
intent.putExtra("ListViewValue", IdList.get(position));
startActivity(intent);
}
});
//send data to service
Intent serviceIntent = new
Intent(Activity.this,ActivityService.class);
serviceIntent.putExtra("ListViewValue", IdList.get(position));
startService(serviceIntent);
my problem is when I Try to add that putExtra directly to my service class, it give me an error that said IdList.get(position) red color for position,
I try to remove the get.(position) but it give me a null one, anyone know how to fix this?