I have developed one android application listview with loadmore button using xml parsing.
I have followed this tutorial:Android ListView with Load More Button
Here i have to implement one part:
If my xml feed is empty means how can i hide the button on pervious page.please help me. I have wrote the below code means hide the button on empty page.but i wish to hide the button on lastpage(previous page of empty page).
For Eg:
Totally i have 4 pages.the 4 pages have feed values and 5th page have empty feed means i have to hide the button on 4th page.how can i do.please help me.
This is my php code:
How can i hide the button on last page.
I have followed this tutorial:Android ListView with Load More Button
Here i have to implement one part:
If my xml feed is empty means how can i hide the button on pervious page.please help me. I have wrote the below code means hide the button on empty page.but i wish to hide the button on lastpage(previous page of empty page).
For Eg:
Totally i have 4 pages.the 4 pages have feed values and 5th page have empty feed means i have to hide the button on 4th page.how can i do.please help me.
Code:
if(nl.getLength() == 0 )
{
btnLoadMore.setVisibility(View.GONE);
pDialog.dismiss();
}
<?php
require "./auth.php";
set_time_limit ( 186400 );
$catid=1;
$catname = func_query_first_cell("select status from $sql_tbl[orders] ORDER BY orderid DESC");
$_xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
$_xml .= "<Feed>";
$_xml .= "<order>";
$page = (int)(!isset($_GET["page"]) ? 1 : $_GET["page"]);
$limit = 5;
$startpoint = ($page * $limit) - $limit;
$statement = "`xcart_orders` where `active` = 1";
$counterr = 0;
$r=func_query("select * from $sql_tbl[orders] ORDER BY orderid DESC LIMIT {$startpoint}, {$limit}");
foreach ($r as $n)
{
$products = func_query_first("select * from $sql_tbl[orders] ORDER BY orderid DESC");
$products = func_query_first("select product from $sql_tbl[order_details] where orderid=$n[orderid]");
$infeed_counter++;
if ($row[avail] > 0)
$avail = 'Y';
else
$avail = 'N';
$_xml .= "<Order>";
$_xml .= "<orderid>" . $n[orderid] . "</orderid>";
$_xml .= "<login>" . htmlspecialchars(strip_tags(substr($n[login], 0, 50)), ENT_QUOTES) . "</login>";
$_xml .= "<total>" . $n[total] . "</total>";
$_xml .= "<product>" . $products[product] . "</product>";
$_xml .="\t<status>" .$n[status]. "</status>\r\n";
$_xml .= "</Order>";
}
$_xml .= "</order>";
$_xml .= "</Feed>";
header ("Content-Type:text/xml");
echo $_xml;
?>
How can i hide the button on last page.