diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index a870c406..47406101 100755 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -35,6 +35,7 @@ import org.xmlpull.v1.XmlPullParserException; import android.annotation.SuppressLint; import android.annotation.TargetApi; +import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -688,6 +689,12 @@ public class CordovaWebView extends WebView { * */ private void loadConfiguration() { + Activity action = this.cordova.getActivity(); + if(action == null) + { + LOG.i("CordovaLog", "There is no activity. Is this on the lock screen?"); + return; + } int id = getResources().getIdentifier("config", "xml", this.cordova.getActivity().getPackageName()); if(id == 0) { diff --git a/test/src/org/apache/cordova/test/CordovaTest.java b/test/src/org/apache/cordova/test/CordovaTest.java index 64cd036b..fdded36f 100644 --- a/test/src/org/apache/cordova/test/CordovaTest.java +++ b/test/src/org/apache/cordova/test/CordovaTest.java @@ -51,7 +51,8 @@ public class CordovaTest extends String className = testView.getClass().getSimpleName(); assertTrue(className.equals("CordovaWebView")); } -/* + + /* public void testForPluginManager() { CordovaWebView v = (CordovaWebView) testView; PluginManager p = v.getPluginManager(); diff --git a/test/src/org/apache/cordova/test/CordovaWebViewTestActivity.java b/test/src/org/apache/cordova/test/CordovaWebViewTestActivity.java index 7f969488..675ecc79 100644 --- a/test/src/org/apache/cordova/test/CordovaWebViewTestActivity.java +++ b/test/src/org/apache/cordova/test/CordovaWebViewTestActivity.java @@ -69,9 +69,9 @@ public class CordovaWebViewTestActivity extends Activity implements CordovaInter } + //Note: This must always return an activity! public Activity getActivity() { - // TODO Auto-generated method stub - return null; + return this; } @Deprecated