set action bar title to article title if available

This commit is contained in:
cip 2013-04-05 11:30:50 +02:00
parent 7d4abceacc
commit aa93e08d20

View File

@ -189,7 +189,16 @@ public class KiwixMobileActivity extends Activity {
String errorString = String.format(getResources().getString(R.string.error_articleurlnotfound), failingUrl);
//TODO apparently screws up back/forward
webView.loadDataWithBaseURL("file://error","<html><body>"+errorString+"</body></html>", "text/html", "utf-8", failingUrl);
String title = getResources().getString(R.string.app_name);
getActionBar().setTitle(title);
}
public void onPageFinished(WebView view, String url) {
String title = getResources().getString(R.string.app_name);
if (webView.getTitle()!=null && !webView.getTitle().isEmpty())
title = webView.getTitle();
getActionBar().setTitle(title);
}
});
//Pinch to zoom