Whenever a user presses the search button and the SearchView component is shown, it goes back to the button MenuItem once a query is submitted.

However, when a user press the Back key, only the keyboard is hidden but the SearchView component is still visible. If you press the Back key again, one would expect the SearchView to be iconified but the app exits instead.

The workaround for this is to add an OnFocusChangeListener to the SearchView component. Whenever the keyboard gets shown and hidden, the onFocusChange() method gets called.

Here is the code:

While this is not really an error, extra data that is not used should not be included in any output as it will only add to the extra bytes.

When you look at your JSON output, you realized the column names and values also have extra index column numbers and the associated values included.

To remove this, simply add an option in the PDO when you instantiate a database connection in PHP like this:

That should fix the problem. When you use json_encode(), there will be no more duplicate values with the corresponding column index number as key.

Related Posts Plugin for WordPress, Blogger...