document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. package mediatutorial.web.id.panggilaplikasi;
  2.  
  3. import android.content.Intent;
  4. import android.net.Uri;
  5. import android.support.v7.app.ActionBarActivity;
  6. import android.os.Bundle;
  7. import android.view.Menu;
  8. import android.view.MenuItem;
  9. import android.view.View;
  10.  
  11.  
  12. public class MainActivity extends ActionBarActivity {
  13.  
  14.     @Override
  15.     protected void onCreate(Bundle savedInstanceState) {
  16.         super.onCreate(savedInstanceState);
  17.         setContentView(R.layout.activity_main);
  18.     }
  19.  
  20.  
  21.     @Override
  22.     public boolean onCreateOptionsMenu(Menu menu) {
  23.         // Inflate the menu; this adds items to the action bar if it is present.
  24.         getMenuInflater().inflate(R.menu.menu_main, menu);
  25.         return true;
  26.     }
  27.  
  28.     @Override
  29.     public boolean onOptionsItemSelected(MenuItem item) {
  30.         // Handle action bar item clicks here. The action bar will
  31.         // automatically handle clicks on the Home/Up button, so long
  32.         // as you specify a parent activity in AndroidManifest.xml.
  33.         int id = item.getItemId();
  34.  
  35.         //noinspection SimplifiableIfStatement
  36.         if (id == R.id.action_settings) {
  37.             return true;
  38.         }
  39.  
  40.         return super.onOptionsItemSelected(item);
  41.     }
  42.  
  43.     public void bukaMediatutorial(View view) {
  44.         Intent intent = new Intent(Intent.ACTION_VIEW,
  45.                 Uri.parse("http://www.mediatutorial.web.id"));
  46.         //bisa juga pakai seperti ini
  47.         /*Intent intent = new Intent(Intent.ACTION_VIEW);
  48.         intent.setData(Uri.parse("http://www.mediatutorial.web.id"));*/
  49.  
  50.         startActivity(intent);
  51.     }
  52. }
');