CopyPastor

Detecting plagiarism made easy.

Score: 1.7319462895393372; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2019-01-13
by milad salimi

Original Post

Original - Posted on 2018-02-26
by AskNilesh



            
Present in both answers; Present only in the new answer; Present only in the old answer;

This method was deprecated in API level 26.1.0.
Instead of MenuItemCompat.OnActionExpandListener
Use MenuItem.OnActionExpandListener directly.
**SAMPLE CODE**
MenuItem item = menu.findItem(R.id.action_order); item.setOnActionExpandListener(new MenuItem.OnActionExpandListener() { @Override public boolean onMenuItemActionExpand(MenuItem menuItem) { isSearch = true; return true; } @Override public boolean onMenuItemActionCollapse(MenuItem menuItem) { isSearch = false; return true; } });
You can get help [this][1] too.

[1]: https://developer.android.com/reference/android/support/v4/view/MenuItemCompat#setOnActionExpandListener(android.view.MenuItem,%20android.support.v4.view.MenuItemCompat.OnActionExpandListener)
>`android.support.v4.view.MenuItemCompat.setOnActionExpandListener` is deprecated
Yes **`MenuItemCompat.setOnActionExpandListener`** This method was deprecated in API level 26.1.0.
>Suggestions?
Use [**`MenuItem.setOnActionExpandListener(MenuItem.OnActionExpandListener)`**][1] directly.
-
**`MenuItemCompat.OnActionExpandListener`** on this menu item to be notified when the associated action `view` is expanded or collapsed. The `menu item` must be configured to expand or collapse its action `view` using the flag `SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW`.
**SAMPLE CODE**

MenuItem item = menu.findItem(R.id.action_order); item.setOnActionExpandListener(new MenuItem.OnActionExpandListener() { @Override public boolean onMenuItemActionExpand(MenuItem menuItem) { isSearch = true; return true; } @Override public boolean onMenuItemActionCollapse(MenuItem menuItem) { isSearch = false; return true; } });

[1]: https://developer.android.com/reference/android/support/v4/view/MenuItemCompat.html#setOnActionExpandListener(android.view.MenuItem,%20android.support.v4.view.MenuItemCompat.OnActionExpandListener)

        
Present in both answers; Present only in the new answer; Present only in the old answer;