mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
CB-800: Fix preferences for the CordovaWebView. - Test case needed to implement CordovaInterface.
This commit is contained in:
parent
ffa1eb1ee9
commit
f74d8aaf2b
@ -28,6 +28,6 @@ public class CordovaActivity extends DroidGap {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
super.loadUrl("file:///android_asset/index.html");
|
super.loadUrl("file:///android_asset/www/index.html");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,28 +20,76 @@
|
|||||||
package org.apache.cordova.test;
|
package org.apache.cordova.test;
|
||||||
|
|
||||||
import org.apache.cordova.CordovaWebView;
|
import org.apache.cordova.CordovaWebView;
|
||||||
|
import org.apache.cordova.api.CordovaInterface;
|
||||||
|
import org.apache.cordova.api.IPlugin;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
public class CordovaWebViewTestActivity extends Activity implements CordovaInterface {
|
||||||
|
|
||||||
public class CordovaWebViewTestActivity extends Activity {
|
|
||||||
|
|
||||||
CordovaWebView phoneGap;
|
CordovaWebView phoneGap;
|
||||||
|
|
||||||
/** Called when the activity is first created. */
|
/** Called when the activity is first created. */
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.main);
|
setContentView(R.layout.main);
|
||||||
|
|
||||||
phoneGap = (CordovaWebView) findViewById(R.id.phoneGapView);
|
phoneGap = (CordovaWebView) findViewById(R.id.phoneGapView);
|
||||||
|
|
||||||
phoneGap.loadUrl("file:///android_asset/www/index.html");
|
phoneGap.loadUrl("file:///android_asset/www/index.html");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDestroy()
|
public void onDestroy()
|
||||||
{
|
{
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
//phoneGap.onDestroy();
|
//phoneGap.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void startActivityForResult(IPlugin command, Intent intent, int requestCode) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setActivityResultCallback(IPlugin plugin) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindBackButton(boolean override) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBackButtonBound() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Activity getActivity() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancelLoadUrl() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object onMessage(String id, Object data) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user