Alice Lee | e4839c3 | 2015-09-04 15:11:35 -0700 | [diff] [blame] | 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.assist.common.Utils; |
| 20 | |
| 21 | import android.app.Activity; |
| 22 | import android.content.Intent; |
| 23 | import android.os.Bundle; |
| 24 | import android.util.Log; |
| 25 | import android.view.View; |
| 26 | import android.webkit.WebView; |
| 27 | import android.webkit.WebViewClient; |
| 28 | |
| 29 | import java.lang.Override; |
| 30 | |
| 31 | public class WebViewActivity extends Activity { |
| 32 | static final String TAG = "WebViewActivity"; |
| 33 | |
| 34 | private String mTestCaseName; |
| 35 | |
| 36 | @Override |
| 37 | public void onCreate(Bundle savedInstanceState) { |
| 38 | super.onCreate(savedInstanceState); |
| 39 | Log.i(TAG, "TestApp created"); |
| 40 | mTestCaseName = getIntent().getStringExtra(Utils.TESTCASE_TYPE); |
| 41 | setContentView(R.layout.webview); |
| 42 | WebView webview = (WebView) findViewById(R.id.webview); |
| 43 | webview.setWebViewClient(new WebViewClient() { |
| 44 | @Override |
| 45 | public void onPageFinished(WebView view, String url){ |
| 46 | sendBroadcast(new Intent(Utils.APP_3P_HASRESUMED)); |
| 47 | } |
| 48 | }); |
| 49 | webview.loadData(Utils.WEBVIEW_HTML, "text/html", "UTF-8"); |
| 50 | //webview.loadUrl( |
| 51 | // "https://android-developers.blogspot.com/2015/08/m-developer-preview-3-final-sdk.html"); |
| 52 | } |
| 53 | } |