• 4
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Android MenuItemCompat.getActionView is Deprecated

I am implementing a SearchView like this:

    MenuItem search = menu.findItem(R.id.search);
SearchView searchView = (SearchView) MenuItemCompat.getActionView(search);

But this gives me an inspection report

'getActionView(android.view.MenuItem)' is deprecated

Now in the docs, it is mentioned:

This method was deprecated in API level 26.0.0

Use getActionView() directly.

So I tried this:

    MenuItem search = menu.findItem(R.id.search);
    SearchView searchView = (SearchView) getActionView(search);

But it still gives me the deprecated message. So what is the best practice?