+2 votes
297 views

SI MUNDET QE WEB VIEW I IM TE HAP VIDEO NGA INTERNETI

asked in Programim by (560 points)   | 297 views

1 Answer

0 votes

1.
Tek AndroidManifest.xml, Shto:

android:debuggable="true"

posht < application> tag
2.
tek < manifest > vendos

<uses-permission android:name="android.permission.INTERNET" />

3.

    package com.programi.pamje;
    
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.webkit.WebView;
    import android.webkit.WebViewClient;
    
    public class MainActivity extends AppCompatActivity {
    
        private WebView webview;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            webview =(WebView)findViewById(R.id.webView);
    
            webview.setWebViewClient(new WebViewClient());
            webview.getSettings().setJavaScriptEnabled(true);
            webview.getSettings().setDomStorageEnabled(true);
            webview.setOverScrollMode(WebView.OVER_SCROLL_NEVER);
            webview.loadUrl("https://www.google.com");
    
        }

}
  • Importo android.webkit.WebView and android.webkit.WebViewClient (lines 5 and 6)
  • shto private WebView webview ; (line 10)
  • Shto permbajtje e duhur ne webview (lines 17–23)
  • Shenim: rrjeshti 22 heq efektin bounce ne web browser
    4.shto activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.diamondium.samplewebview.MainActivity">

    <WebView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/webView"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

</android.support.constraint.ConstraintLayout>
answered by Mjeshtër (6.3k points)  
pershendetje po me nxjerr per fat te keq app ndaloi te lutem a me ndihmon me team viewer me duhet  shume te lutem .https://www.facebook.com/ergialb1 fb i im te lutem si  mund te ju kontaktoj
sot ne oren 21:00 do merrni nje mesazh privat ketu ne stack
ne rregull i nderuar
pershendetje i ndeuar me thate se do me kontaktonit
ju kam nisur mesazh privat
Mirë se vini në StackOverFlow Albania, ku mund të bëni pyetje dhe merrni përgjigje nga anëtarët e tjerë të komunitetit.

  1. redian.copa

    140 pikë

  2. HyGert Metallari

    140 pikë

  3. EvaPartin814

    100 pikë

  4. Surrealtudo41

    100 pikë

Dhurata mujore
1. Vendi pare: Profesor
2. Vendi dyte: Mjeshtër
3. Vendi 3: Student

16 në linjë
11 Antar dhe 5 mysafir
Vizitat sot : 3845
Vizitat e djeshme : 5789
Të gjitha Vizitat : 232134
62 questions
118 answers
108 comments
2,139 users