1 // Copyright (c) 2014 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 package org.xwalk.core.sample;
7 import org.xwalk.core.XWalkView;
9 import android.os.Bundle;
10 import android.widget.LinearLayout;
12 public class MultiXWalkViewActivity extends XWalkBaseActivity {
14 private XWalkView mXWalkView2;
17 protected void onCreate(Bundle savedInstanceState) {
18 super.onCreate(savedInstanceState);
20 setContentView(R.layout.container);
21 LinearLayout parent = (LinearLayout) findViewById(R.id.container);
23 LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
24 LinearLayout.LayoutParams.MATCH_PARENT,
25 LinearLayout.LayoutParams.MATCH_PARENT);
28 mXWalkView = new XWalkView(this, this);
29 parent.addView(mXWalkView, params);
31 mXWalkView2 = new XWalkView(this, this);
32 parent.addView(mXWalkView2, params);
34 mXWalkView.load("http://www.intel.com", null);
35 mXWalkView2.load("http://www.baidu.com", null);
39 public void onPause() {
41 if (mXWalkView2 != null) {
43 mXWalkView2.pauseTimers();
48 public void onResume() {
50 if (mXWalkView2 != null) {
52 mXWalkView2.resumeTimers();
57 public void onDestroy() {
59 if (mXWalkView2 != null) {
60 mXWalkView2.onDestroy();