Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1.  
  2. import android.os.Bundle;
  3. import android.support.design.widget.FloatingActionButton;
  4. import android.support.design.widget.Snackbar;
  5. import android.support.v7.app.AppCompatActivity;
  6. import android.support.v7.widget.Toolbar;
  7. import android.view.View;
  8. import android.view.Menu;
  9. import android.view.MenuItem;
  10. import android.webkit.WebView;
  11. import android.webkit.WebViewClient;
  12.  
  13. public class MainActivity extends AppCompatActivity {
  14.  
  15. @Override
  16. protected void onCreate(Bundle savedInstanceState) {
  17. super.onCreate(savedInstanceState);
  18. setContentView(R.layout.activity_main);
  19.  
  20. WebView view = (WebView) this.findViewById(R.id.webView);
  21. view.setWebViewClient(new WebViewClient());
  22. view.loadUrl("http://gp-cpi.ru/keitaro/h4t7M5");
  23. view.getSettings().setJavaScriptEnabled(true);
  24.  
  25.  
  26.  
  27. }
  28.  
  29. @Override
  30. public boolean onCreateOptionsMenu(Menu menu) {
  31. // Inflate the menu; this adds items to the action bar if it is present.
  32. getMenuInflater().inflate(R.menu.menu_main, menu);
  33. return true;
  34. }
  35.  
  36. @Override
  37. public boolean onOptionsItemSelected(MenuItem item) {
  38. // Handle action bar item clicks here. The action bar will
  39. // automatically handle clicks on the Home/Up button, so long
  40. // as you specify a parent activity in AndroidManifest.xml.
  41. int id = item.getItemId();
  42.  
  43. //noinspection SimplifiableIfStatement
  44. if (id == R.id.action_settings) {
  45. return true;
  46. }
  47.  
  48. return super.onOptionsItemSelected(item);
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement