android Set subtitle to zimfile title.

null apparently just clear subtitle which is fine
This commit is contained in:
cip 2013-04-05 14:32:41 +02:00
parent 5f79e60402
commit ab3dd2048c
2 changed files with 16 additions and 0 deletions

View File

@ -378,6 +378,9 @@ public class KiwixMobileActivity extends Activity {
private boolean openZimFile(File file, boolean clearHistory) {
if (file.exists()) {
if (ZimContentProvider.setZimFile(file.getAbsolutePath())!=null) {
getActionBar().setSubtitle(ZimContentProvider.getZimFileTitle());
//Apparently with webView.clearHistory() only
// history before currently (fully) loaded page is cleared
// -> request clear, actual clear done after load.

View File

@ -58,7 +58,20 @@ public class ZimContentProvider extends ContentProvider {
public static String getZimFile() {
return zimFileName;
}
public static String getZimFileTitle() {
if (jniKiwix==null)
return null;
else {
JNIKiwixString title = new JNIKiwixString();
if (jniKiwix.getTitle(title)) {
return title.value;
}
else return null;
}
}
public native boolean getTitle(JNIKiwixString title);
public static String getMainPage() {
if (jniKiwix==null)
return null;