Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to get the url after loading page in webview in andorid

public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        WebView webView = findViewById(R.id.webview);
        webView.loadUrl("http://www.google.com");
        webView.setWebViewClient(new WebViewClient(){
            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
                Toast.makeText(getApplicationContext(), url,Toast.LENGTH_LONG).show();
            }
        });
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java unfocus 
Java :: online currency rate api 
Java :: TYPE_INT_ARGB 
Java :: java replace ignore case 
Java :: java log4j2 load configuration 
Java :: Which type of Exception will be thrown by forName() method 
Java :: convert int to array in java 
Java :: verificar numero par ou impar jacva 
Java :: Create dynamic tree view using JavaScript 
Java :: RecyclerView scrolled UP/DOWN listener 
Java :: java print line 
Java :: java gui lookandfeel flatlaf background color 
Java :: check if object is a string java 
Java :: How to Implement GET and POST Requests With Java 
Java :: navigation view item selected 
Java :: RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API 
Java :: fill a 2d array java 
Java :: collapse recycler view on new item click 
Java :: Selenium TestNG delay before actions 
Java :: java 8 validate based on pair of strings 
Java :: code to determine distance and time in java 
Java :: java throw exception without method signature 
Java :: Composite primary key jpa 
Java :: They say that they have to create an instance to their application. What does it mean? 
Java :: how to use java code to print with a network printer 
Java :: java focus to desktop 
Java :: quick way to get charAt 
Java :: java 8 seconds to days 
Java :: date data type in java 
Java :: calculate number of weeks between two dates 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =