I got a asynctask listview that displays name, email, phonenumber. I update the name of the selected item on a dialog box but it shows it as an array. How can make it show a specific value for example "Name"?
Default: Name: name1, email:[email protected], mobile:000 When I open dialog box textview will show {email=email,name=name,id=c201,mobile=000}
I want this to show just 'name' on the textview
ListView lv = getListView();
// Listview on item click listener
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, final View view, final int position, long id) {
// getting values from selected ListItem
final String name = ((TextView) view.findViewById(R.id.name)).getText().toString();
String cost = ((TextView) view.findViewById(R.id.email)).getText().toString();
String description = ((TextView) view.findViewById(R.id.mobile)).getText().toString();
// Create custom dialog object
final Dialog dialog = new Dialog(MainActivity.this);
// Include dialog.xml file
dialog.setContentView(R.layout.custom);
// Set dialog title
dialog.setTitle("Custom Dialog");
// set values for custom dialog components - text, image and button
final TextView text = (TextView) dialog.findViewById(R.id.name_label);
text.setTextColor(Color.GREEN);
dialog.show();
new CountDownTimer(30000, 1000) {
public void onTick(long millisUntilFinished) {
String itemValue = (lv.getItemAtPosition(position).toString());
text.setText(itemValue);
}
public void onFinish() {
}
}.start();
}