fixed not working reload button

This commit is contained in:
leCradle 2013-03-10 20:59:36 +01:00
parent 897ce2e9f1
commit 5e0efc501b
3 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,7 @@
package com.cradle.iitc_mobile;
import java.io.IOException;
import com.cradle.iitc_mobile.R;
import android.net.Uri;
@ -105,12 +107,18 @@ public class IITC_Mobile extends Activity {
return true;
}
@SuppressWarnings("static-access")
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.reload_button:
iitc_view.reload();
try {
iitc_view.getWebViewClient().loadIITC_JS(this);
} catch (IOException e1) {
e1.printStackTrace();
}
return true;
// print version number
case R.id.version_num:

View File

@ -55,4 +55,8 @@ public class IITC_WebView extends WebView {
}
//----------------------------------------------------------------
public IITC_WebViewClient getWebViewClient() {
return this.webclient;
}
}

View File

@ -26,7 +26,7 @@ public class IITC_WebViewClient extends WebViewClient {
}
}
private static void loadIITC_JS(Context c) throws java.io.IOException {
public static void loadIITC_JS(Context c) throws java.io.IOException {
InputStream input;
input = c.getAssets().open("iitc.js");