The following code sends a call forwarding command via intent
Intent intentCallForward = new Intent(Intent.ACTION_CALL);
intentCallForward.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromParts("tel", "*21*001234567890#", "#");
intentCallForward.setData(uri);
startActivity(intentCallForward);
The issue with this code is that it shows a popup which is a bit weird, is there a way to prevent this? Maybe via NDK or something like that?
Thanks in advance
The intent invokes the phone's phone activity. It is the source of your pop-up.
That is why you cannot change it or disable it.
If it really bothers you, you can include in your app some other calling activity and perform the call internally (not via intent), but I'm not sure such thing even possible, and it is surely doesn't worth the effort.
Related
I am trying to open the Network Operator Settings view with the following code:
startActivity(new Intent(android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS));
It works correctly on all the devices I could test, but on one of them (Alcatel One Touch Pixi, with Android 5.1) the Network Operator Settings view opens and automatically closes after that. I tried to see if the resolveActivity with the packageManager of that Intent returns null, but it does not, it opens the activity of network operator settings and then (for some reason) it automatically finishes.
Anyone can help me to fix this issue that only happens with some specific mobiles?
There's an alternative way to call the Network Settings menu:
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.android.phone", "com.android.phone.MobileNetworkSettings"));
startActivity(intent);
This method works with Samsung devices but not sure about devices that you mentioned (since I'm specifying the name of the package and the activity class name).
I think you can try and if works, you may add the proper conditions to use this code etc.
You cannot fix the issue. The other app has a bug. Only its developers can fix the bug.
wireless settings
startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));
Network Operator Settings
startActivity(new Intent(Settings.ACTION_NETWORK_OPERATOR_SETTINGS));
I want my app to open whenever the user makes a call. I am able to know that call has started but cant open my app. Is there any way i can do that.
Thanks in advance
When you know that a call has started, use your package name / class directly, for example to create a new intent to call the twidroid program you'd use the followinglink text:
Intent intent = new Intent("com.twidroid.SendTweet");
You'd probably want to put a try/catch around for a ActivityNotFoundException for when the application is not installed.
I have a webview in my app, on trying to do actions like making a call (Tapping call button from results displayed in webview), sending mails and other actions, my webview doesn't perform those actions
I Found a solution to add the intent actions in my web view activity as
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
startActivity(intent)
Instead of doing so is there any way to add in the android manifest file
or Is there any way to turn on all of the intent actions for the webview so that
there wont be further issues in handling the actions
Can someone help me on this pls
Your answer seems to me a bit strange, I think you are a bit confuse about the difference between Intent and manifest permission. The first one are the system used by android to let app communicate with each other, the second one allow you to use some feature of the device like wifi and direct phone call that need the explicit agreement of the user to be used (the prompt that popup when you make the first install of an app).
With this clarification it is clear that if you want to do something that require another app you will have to make an Intent. This Intent, if well formed, will be elaborated by the os that will take care of sending it to the correct application able to accomplish the Intentrequirement.
So the answer to your question, as far as i know, is no, you have to use intent if you have the need of calling external app. It's also a good practice to set in the manifest only the permission really needed by the app, this way the user know what the app really can do and and what it can't do.
Hope i understand your question and answer it.
I am using this code to make call
Intent callIntent = new Intent(Intent.ACTION_CALL,
Uri.parse("tel:" + phoneNumber));
startActivity(callIntent);
and I want to disconnect call after hear first ringing to leave a miss call on the destination phone.
I don't believe that's currently available in the Android sdk. I was trying to control outgoing calls on a project recently but other than dialing a number there's not a lot you can do. My last project needed to place a call, press a button, then hangup. For that I ended up setting up an Asterisk server that listened to a web page. You could do something similar but that would involve using a data connection to your own server.
You can check out these links. I don't like this answer but it's the way it is for now.
How to make a phone call in android and come back to my activity when the call is done?
http://developer.android.com/reference/android/content/Intent.html#ACTION_CALL
If you want to step outside of techniques I would recommend check out the this answer.
I'm in the middle of an app where a function is implemented in its code. I have an intent too. Can this function be executed by this intent on its space. I mean like it iss intents code.
Sorry, I am not certain but think this is not possible. It would go against all security policies android cares about.