Advertisement
deepender

Untitled

Dec 28th, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. import android.app.Activity;
  2. import android.content.ActivityNotFoundException;
  3. import android.content.Intent;
  4. import android.net.Uri;
  5. import android.os.Bundle;
  6. import android.util.Log;
  7.  
  8. public class phonecalls extends Activity {
  9. /** Called when the activity is first created. */
  10. @Override
  11. public void onCreate(Bundle savedInstanceState) {
  12. super.onCreate(savedInstanceState);
  13. setContentView(R.layout.main);
  14. call();
  15. }
  16.  
  17. private void call() {
  18. try {
  19. Intent callIntent = new Intent(Intent.ACTION_CALL);
  20. callIntent.setData(Uri.parse("tel:575757570089"));
  21. startActivity(callIntent);
  22. } catch (ActivityNotFoundException activityException) {
  23. Log.e("dialing-example", "Call failed", activityException);
  24. }
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement