I have ListView in my project which has ListItems as in the form of String like this,
Complete Task By Today
Assign Projects To Developers
Meeting Cancelled
if click any one of the item from ListView means i want that particular String should be displayed in my EditText(i,e if click meeting cancelled, i need this particular String to display in EditText).Any one guide me,This is how i’m trying to Achieve.enter code here Thanks in advance.
final ListView listView = (ListView) findViewById(R.id.taskListDesc);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapter, View view, int selectedItem,
long arg3) {
System.out.println(adapter.getItemAtPosition(selectedItem));
Intent intent = new Intent(getApplicationContext(),
ViewTaskActivity.class);
startActivity(intent);
}
});
}
1 Answer