0% found this document useful (0 votes)
21 views3 pages

Main Activity and Manifest Overview

This document contains code for an Android application that displays a webview loading the URL http://www.davbhagalpur.com. The MainActivity class finds the webview in the activity_main layout and enables JavaScript before loading the given URL. The Android manifest declares the MainActivity as the launcher and defines the internet permission needed to load web content.

Uploaded by

Vaibhav Amrit
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views3 pages

Main Activity and Manifest Overview

This document contains code for an Android application that displays a webview loading the URL http://www.davbhagalpur.com. The MainActivity class finds the webview in the activity_main layout and enables JavaScript before loading the given URL. The Android manifest declares the MainActivity as the launcher and defines the internet permission needed to load web content.

Uploaded by

Vaibhav Amrit
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd

Main Activity.

java

package [Link];

import [Link];
import [Link];
import [Link];
import [Link];

public class MainActivity extends AppCompatActivity {

private WebView mWebView;


@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);

mWebView = (WebView) findViewById([Link].activity_main_webview);


WebSettings webSettings = [Link]();
[Link](true);
[Link]("[Link]
}
}

Android [Link]

<?xml version="1.0" encoding="utf-8"?>


<manifest xmlns:android="[Link]
package="[Link]">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="[Link]" />

<category android:name="[Link]" />


</intent-filter>
</activity>
</application>
<uses-permission android:name="[Link]" />
</manifest>

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<WebView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/activity_main_webview"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp" />

</[Link]>

You might also like