Tag: android-studio

java – How can I finish the ActionMode when no selected item?

The Question : 1 people think this question is useful I want to finish actionmode when there is no item selected. I tried the code below but it didn’t work. bookAdapter.setOnLongClickListener(new RecyclerViewAdapter.OnLongClickListener() { @Override public void onLongClick() { if(mActionMode != null) { if(bookAdapter.getSelectedBooks().isEmpty()) { mActionMode.finish(); } return; } ActionMode.Callback mActionModeCallback = new ActionMode.Callback() { @Override

Android – Layout not appearing as expected [duplicate]

问题内容: This question already has an answer here: ConstraintLayout views in top left corner 3 answers This(1st image) is how the layout is appearing in content_main.xml https://s8.postimg.org/8ie65tzdh/Untitled1.png But this(2nd image) is how it appears in the virtual device. https://s8.postimg.org/wywc0enad/Untitled.png I’m a beginner so I might be missing many things here. All kind of help will