private Uri createTestImageContentUri() { Bitmap imageBitmap = BitmapFactory.decodeResource(activity.getResources(), R.drawable.icon); String stored = MediaStore.Images.Media.insertImage(activity.getContentResolver(), imageBitmap, "app-icon", "desc"); return Uri.parse(stored); }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //CB-7238: This has to be added now, because it got removed from somewhere else Config.init(this); cordovaWebView = (CordovaWebView) findViewById(R.id.cordovaWebView); cordovaWebView.init(this, new CordovaWebViewClient(this, cordovaWebView), new CordovaChromeClient(this, cordovaWebView), Config.getPluginEntries(), Config.getWhitelist(), Config.getExternalWhitelist(), Config.getPreferences()); cordovaWebView.loadUrl("file:///android_asset/www/index.html"); }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // AWV Factory should be initialized before setting the layout if (!sFactoryInit) { factory = AmazonWebKitFactories.getDefaultFactory(); if (factory.isRenderProcess(this)) { return; // Do nothing if this is on render process } factory.initialize(this); sFactoryInit = true; } else { factory = AmazonWebKitFactories.getDefaultFactory(); } setContentView(R.layout.main); //CB-7238: This has to be added now, because it got removed from somewhere else Config.init(this); cordovaWebView = (CordovaWebView) findViewById(R.id.cordovaWebView); factory.initializeWebView(cordovaWebView, 0xFFFFFF, false, null); cordovaWebView.init(this, new CordovaWebViewClient(this, cordovaWebView), new CordovaChromeClient(this, cordovaWebView), Config.getPluginEntries(), Config.getWhitelist(), Config.getExternalWhitelist(), Config.getPreferences()); cordovaWebView.loadUrl("file:///android_asset/www/index.html"); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.init(); // Show splashscreen this.setIntegerProperty("splashscreen", R.drawable.sandy); super.loadUrl("file:///android_asset/www/splashscreen/index.html", 2000); }
protected void setUp() throws Exception { super.setUp(); testActivity = this.getActivity(); testView = (CordovaWebView) testActivity.findViewById(R.id.cordovaWebView); testPlugin = (pluginStub) testView.pluginManager.getPlugin("PluginStub"); solo = new Solo(getInstrumentation(), getActivity()); }
protected void setUp() throws Exception { super.setUp(); testActivity = this.getActivity(); testView = testActivity.findViewById(R.id.cordovaWebView); }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); cordovaWebView = (CordovaWebView) findViewById(R.id.cordovaWebView); cordovaWebView.loadUrl("file:///android_asset/www/index.html"); }