在 android 应用程序中,当我启动活动时,它显示黑屏或应用程序会挂起几秒钟。我想直到黑屏我想显示进度条。我尝试了很多次,但无法做到这一点。
String xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"
+ "<category><Id>" + catId + "</Id></category>";
StringBuilder resXML = new Connection().getResponseString("http://192.168.1.14/virtualMirror/productlisting.php", xml); // TODO URL change
if(!resXML.equals("")) {
XMLParser parser = new XMLParser();
Document doc = parser.getDomElement(resXML.toString()); // getting DOM element
NodeList nodeList = doc.getElementsByTagName("Product");
Intent intent = new Intent(this, ProductListing.class);
Bundle bundle = new Bundle();
bundle.putLong("CategoryId", catId);
bundle.putString("CategoryName", catName);
intent.putExtras(bundle);
startActivity(intent);
}