ListFragment: Don't assume the ListView is the root

It may share the layout with a FAB, and that requires a parent
ViewGroup.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Samuel Holland 2017-08-14 18:40:46 -05:00
parent e6a6605ff8
commit 6604be94eb

View File

@ -23,7 +23,7 @@ public class ConfigListFragment extends BaseConfigFragment {
final ConfigListFragmentBinding binding = final ConfigListFragmentBinding binding =
ConfigListFragmentBinding.inflate(inflater, parent, false); ConfigListFragmentBinding.inflate(inflater, parent, false);
binding.setConfigs(VpnService.getInstance().getConfigs()); binding.setConfigs(VpnService.getInstance().getConfigs());
final ListView listView = (ListView) binding.getRoot(); final ListView listView = binding.getRoot().findViewById(R.id.config_list);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override @Override
public void onItemClick(final AdapterView<?> parent, final View view, public void onItemClick(final AdapterView<?> parent, final View view,