I have button in my Android app to call a desired phone number.
I want to hide this number from callers call log (Yes, I want to hide it from displaying androids call log) is there any possible way for me to display calls made by my app as strings (Eg. if you call 12345678; i want to display it as "my numb")
This is my current code to make the call
public void callUsNow(View v) {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:1234567890"));
con.startActivity(callIntent);
}
Could anyone suggest on this?
Thanks.
No.
If you pass Intent by calling Intent.ACTION_CALL, after con.startActivity(callIntent) other activity will have control over it.
Related
I'm making an app in which you can chat and call with other contacts. But in case of calling, I've designed the app in such a way that after typing the number and clicking on the call icon, it takes you to native calls app for calling and updates the call log in my current app.
For this process, this is the code I've written:
if (nativeCall(mobileNumber)) {
Intent intent = new Intent(Intent.ACTION_CALL).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse("tel:" + mobileNumber));
if (((BaseActivity) context).isNetworkOk()) {
addToUserCallLogs(context, DateUtils.convertTimestampToDate(), contactUri, "Out", System.currentTimeMillis());
}
context.startActivity(intent);
return true;
}
You can see that I'm putting mobile number into the intent and starting it. And I'm using addToUserCallLogs() function to show it in my app's call logs.
This works fine usually, but in the issue is in the following case.
When the user has multiple calling applications(For eg, the user has installed application named SMARTalk. Now he has native caller app and SMARTalk app to call from), in that case the Android system gives options to chose from like this:
Now, if he choses from one of them, even in that case there is no issue. Say he didn't chose any of those and clicked on the other part of the screen. Then this options bar will be closed. Since all this is happening after starting the intent, this call will be added in the call logs of the app from the function addToUserCallLogs(). But I don't want the call to be shown in the call Logs because I haven't done any call.
But according to the code I've written, before starting the intent, I'm adding into my app's call logs database. Is there a way the information of whether the call has happened or not can be sent back from the system to the app?
Or a way to get these options to be shown manually from the app?
Please comment if you need any more explanation.
I guess no way to receive the callback information because ACTION_CALL does not return a result. You can see the output is nothing from docs even you use startActivityForResult
I am developing an app for a cab and have to implement the call facility.I am done with this calling feature but it is showing the dialed number in dialer, but I am in need to hide the dial number from the dialer.we are doing this just to make female passenger safe and comfortable while having the ride and after the ride.
While calling Intent, Use Intent.ACTION_CALL. It will directly call at particular number without showing dialer to user.
Use Intent.ACTION_CALL it will directly call
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:100"));
startActivity(intent);
I am calling a activity from my service when an incoming call ends as given below
Intent callIntent1 = new Intent(Intent.ACTION_CALL);
callIntent1.addCategory(Intent.CATEGORY_HOME);
callIntent1.addCategory(Intent.CATEGORY_LAUNCHER);
callIntent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
callIntent1.setClass(context, com.example.test.MyActivity.class);
Log.d("TAG", "MyActivity");
startActivity(callIntent1);
but my activity starts for a blink and closes and I see the home screen ,my log shows the call given to MyActivity ,I cannot find the reason for this
I think it is because you are not using your intent categories the right way. If you are explicitly calling the startActivity method, you don't need to add a category to your intent. They are meant to be used with intent filters I guess. If you want to detect something, eg a call, a text etc, add an intent filter to your activity.
Edit: see here
In my application I have apply new outgoing call receiver. It is working fine. I get whenever new outgoing call is made.
But now, in my device there are two applications for dial call. First is default dialer and second is my own dialer (Using Call_Privilage).
My question is: when I got broadcast for new dial in my receiver at that time how can I know that from which dialer application call is dialed. From default dialer or my own dialer?
I have not implemented this and tested but I assume like this will work for you.
In your own dialer Activity whenever you are calling intent to make a call,
at that time you should pass one more putExtra with that callIntent
For Ex : callIntent.putExtra("fromMyDialer",1);
Now in your Receiver file, you will be having one method like this below and there you will just need to have check for the extra we passed above.
#Override
public void onReceive(final Context context, final Intent intent) {
if(intent.getIntExtra("fromMyDialer",0)==1)
// from my own dialer activity
else
// from default dialor of phone
}
I want to make a phone call and by the code below:
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:123456789"));
startActivity(intent);
however, when I use those code to make a phone call, the android will show the system view and I don't see my view.How can I hide the system view and only show my view? Thank you !
Placing a call will always bring up the in-call screen. If you do not want that, you will need to create your own modified firmware and run it on your own devices.