You only need 3 headers to make this work and 1 or 2 more lines after that. That is all you need to add in order to have any binary file to force download itself whenever the PHP file is called.

The path to file variable is the absolute path of the file that you wish to have the user force download it.

The 3 headers are important, otherwise they won’t work. The basename function is also important in case you might pass a variable that contains the absolute path of the filename and we do not want other users to see the file structure of your server.

The basename function removes all directory paths and returns the name of the file itself.

That’s it! Easy, right?

A community user in the Oracle forum posted this short snippet in hiding a TableView column header regardless if your table still does not have any data.

The listener will handle the hiding of the header column once it gets triggered.

Most likely you encountered this exception

ClassCastException: LinearLayout$LayoutParams Cannot Be Cast to AbsListView$LayoutParams

because you either added a header and/or footer in the ListView component and when you removed them, you found out there was no error generated.

Explanations aside, to fix this problem just set the LayoutParams of your header or footer like this:

That should solve it.

Related Posts Plugin for WordPress, Blogger...