Jump to content

ActGAM

Members
  • Posts

    1
  • Joined

  • Last visited

ActGAM's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. ActGAM

    Problem z WebView

    Witam, natrafiłem na mały problem pisząc aplikacje na androida a mianowicie, w swojej aplikacji wykorzystuje dwa razy WebView w content_main.xml "id/activity_main_webview" a drugi w nav_header_main.xml "id/webView1" Chciałbym aby po kliknięciu w Sign in through Steam w "id/webView1" z Menu przerzucało mnie do "id/activity_main_webview" czyli na content_main, szukałem już tego na zagranicznych forach ale nie mogę naleźć, pomoże ktoś? A tutaj okrojony kod z MainActivity.java package com.blebleble; import android.os.Bundle; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.KeyEvent; import android.view.MenuItem; import android.view.View; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { private WebView mWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); mWebView = (WebView) findViewById(R.id.activity_main_webview); // Enable Javascript WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); mWebView.loadUrl("url strona główna"); // Force links and redirects to open in the WebView instead of in a browser mWebView.setWebViewClient(new WebViewClient()); static WebView mWebView1; @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. mWebView1 = (WebView) findViewById(R.id.webView1); // Enable Javascript WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); mWebView1.loadUrl("url logowania"); // Force links and redirects to open in the WebView instead of in a browser mWebView1.setWebViewClient(new WebViewClient()); } } } "id/webView1" "id/webView1" "id/activity_main_webview"
×
×
  • Create New...