Home | History | Annotate | Download | only in testapp
      1 /*
      2  * Copyright (C) 2015 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.assist.testapp;
     18 
     19 import android.app.Activity;
     20 import android.assist.common.MyWebView;
     21 import android.assist.common.Utils;
     22 import android.content.Context;
     23 import android.content.Intent;
     24 import android.os.Bundle;
     25 import android.util.Log;
     26 import android.webkit.WebView;
     27 import android.webkit.WebViewClient;
     28 
     29 public class WebViewActivity extends Activity {
     30     static final String TAG = "WebViewActivity";
     31 
     32     private String mTestCaseName;
     33 
     34     @Override
     35     public void onCreate(Bundle savedInstanceState) {
     36         super.onCreate(savedInstanceState);
     37         Log.i(TAG, "TestApp created");
     38         mTestCaseName = getIntent().getStringExtra(Utils.TESTCASE_TYPE);
     39         setContentView(R.layout.webview);
     40         MyWebView webview = (MyWebView) findViewById(R.id.webview);
     41         webview.setWebViewClient(new WebViewClient() {
     42             @Override
     43             public void onPageFinished(WebView view, String url){
     44                 sendBroadcast(new Intent(Utils.APP_3P_HASRESUMED));
     45             }
     46         });
     47         webview.myLoadData(Utils.WEBVIEW_HTML_URL, Utils.WEBVIEW_HTML, "text/html", "UTF-8");
     48         webview.setLocaleList(Utils.WEBVIEW_LOCALE_LIST);
     49         //webview.loadUrl(
     50         //        "https://android-developers.blogspot.com/2015/08/m-developer-preview-3-final-sdk.html");
     51     }
     52 }
     53