Advertisement
wmdcms

Eclipse URL in Aplication

Oct 12th, 2014
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.39 KB | None | 0 0
  1. package com.wmd.wmd;
  2.  
  3. import android.support.v7.app.ActionBarActivity;
  4. import android.os.Bundle;
  5. import android.view.Menu;
  6. import android.view.MenuItem;
  7.  
  8. //Ovaj dio koda sam dodao
  9. //odavde
  10. import android.webkit.WebView;
  11. //dovde
  12.  
  13.  
  14. public class MainActivity extends ActionBarActivity {
  15.  
  16.     @Override
  17.     protected void onCreate(Bundle savedInstanceState) {
  18.         super.onCreate(savedInstanceState);
  19.         setContentView(R.layout.activity_main);
  20.        
  21.        
  22.         //Ovaj kod sam dodao
  23.         //odavde
  24.         String url = "http://mojsat.com/folder/folder/index.php";
  25.         WebView view = (WebView) this.findViewById(R.id.webView1);
  26.         view.loadUrl(url);
  27.         //dovde
  28.     }
  29.  
  30.  
  31.     @Override
  32.     public boolean onCreateOptionsMenu(Menu menu) {
  33.         // Inflate the menu; this adds items to the action bar if it is present.
  34.         getMenuInflater().inflate(R.menu.main, menu);
  35.         return true;
  36.     }
  37.  
  38.     @Override
  39.     public boolean onOptionsItemSelected(MenuItem item) {
  40.         // Handle action bar item clicks here. The action bar will
  41.         // automatically handle clicks on the Home/Up button, so long
  42.         // as you specify a parent activity in AndroidManifest.xml.
  43.         int id = item.getItemId();
  44.         if (id == R.id.action_settings) {
  45.             return true;
  46.         }
  47.         return super.onOptionsItemSelected(item);
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement