I keep getting a runtime error when I try to launch an activity.
Line where the error happen:
private OnItemClickListener mDeviceClickListener = new OnIt
From the documentation:
View: The view within the AdapterView that was clicked (this will be a view provided by the adapter)
In your case the View
is the root ConstraintLayout
. And as the error says you can't cast it to TextView
. To get the info you can use:
String info = v.findViewById(R.id.textView).getText().toString()
You just got wrong id for your constrain layout and mixed it up with textview that you have make declaration in MainActivity