Good day! !!! There was a problem with ListVeiw, hung on him pressing

listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { //View v = findViewById(R.id.remote_video_progress); @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { LayoutInflater inflater = getLayoutInflater(); dialogView = inflater.inflate(R.layout.activity_remote, null); AlertDialog.Builder builder = new AlertDialog.Builder(ServerActivity.this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { builder.setTitle(phoneNumbers.get(position)) .setView(dialogView) .setCancelable(false) .setNegativeButton("ОК", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); } AlertDialog alert = builder.create(); alert.show(); } }); 

but unfortunately the click does not work, from the first time, it means that you have to click on the element for a long time, or press and hold a little. I use SimpleAdapter and my own markup for an element with TextVeiw and ProgressBar (I set clickble = "false", focusable = "false", focusableInTouchMode = "false" on them), add elements from when the client connects to this phone, and I update from the client, in the timer every second. Where can delay lurk?

  • I don't see any delay in your code. Little data. And what is in this method - phoneNumbers.get(position) ? - Ivan

1 answer 1

phoneNumbers.get (position) is just a list of the absent serial number of the client. The delay was in the timer, I did not consider that time is considered in milliseconds (((((Accordingly, he updated the ListVeiw every millisecond !!!