Advertisement
heru-kzw

call

Apr 25th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.60 KB | None | 0 0
  1.  Button  Maps=(Button)findViewById(R.id.btnMap);
  2.         Maps.setOnClickListener(new View.OnClickListener() {
  3.                 public void onClick(View arg0) {
  4.                     Intent intent = new Intent(android.content.Intent.ACTION_VIEW,      Uri.parse("https://maps.google.com/maps?saddr="+lati0+","+longi0+"&daddr="+lati+","+longi));                   
  5.                     startActivity(intent);
  6.  
  7.         }});  
  8.        
  9.         Button  Call=(Button)findViewById(R.id.btnCall);
  10.         Call.setOnClickListener(new View.OnClickListener() {
  11.                 public void onClick(View arg0) {
  12.                     String toDial="tel:"+telp;
  13.                     startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse(toDial)));
  14.  
  15.                    
  16.         }});  
  17.        
  18.  
  19.         Button  Sms=(Button)findViewById(R.id.btnSms);
  20.         Sms.setOnClickListener(new View.OnClickListener() {
  21.                 public void onClick(View arg0) {
  22.                     Intent  i= new Intent(detail.this, Sms.class);
  23.                     startActivity(i);
  24.                    
  25.         }});  
  26.        
  27.  
  28.         Button  Web=(Button)findViewById(R.id.btnWeb);
  29.         Web.setOnClickListener(new View.OnClickListener() {
  30.                 public void onClick(View arg0) {
  31.                     Intent intent = new Intent(android.content.Intent.ACTION_VIEW,      Uri.parse(url));                   
  32.                     startActivity(intent);
  33.         }});  
  34.        
  35.  
  36.         Button  Youtube=(Button)findViewById(R.id.btnYoutube);
  37.         Youtube.setOnClickListener(new View.OnClickListener() {
  38.                 public void onClick(View arg0) {
  39.                     Intent  i= new Intent(detail.this, Youtube.class);
  40.                     startActivity(i);
  41.                    
  42.         }});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement