2

I hae the following code to dial a number

package com.example.callapp;

import android.app.Activity;
import android.content.Intent;   
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;



public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main); 

makecall(); }

public void makecall()
    { 
    Intent call = new Intent(Intent.ACTION_CALL);
    call.setData(Uri.parse("tel:90324567"));
    startActivity(call);
    }

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}

}

Now when i run this app it brings up a dialer and dials the number. I would like to hide the dialer and show the call activity in app - say Dialing this number - XXXX

And how do I end the call after specific time? and show the message on app screen with the time?

j0k
  • 22,600
  • 28
  • 79
  • 90
user2074894
  • 47
  • 3
  • 10

0 Answers0