Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- codice mainactivity.java:
- package com.animanerdfamily.app.test1;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.webkit.WebView;
- import android.webkit.WebViewClient;
- import com.animanerdfamily.app.test1.R;
- public class MainActivity extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- WebView myWebView = (WebView) findViewById(R.id.WebView);
- myWebView.setWebViewClient(new WebViewClient());
- myWebView.loadUrl("http://www.animanerdfamily.it/");
- }
- }
- Codice activity.xml:
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.animanerdfamily.app.test1.MainActivity">
- <WebView
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:id="@+id/webview"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true" />
- </RelativeLayout>
- Codice Androidmanifest.xml:
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.animanerdfamily.app.test1">
- <uses-permission android:name="android.permission.INTERNET"></uses-permission>
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
- <application
- android:allowBackup="true"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:supportsRtl="true"
- android:theme="@style/AppTheme">
- <activity android:name=".MainActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
- </manifest>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement