Android :: How To Accept An Incoming Call By Clicking A Button
May 6, 2010
I'm trying to implement my own phone call handling UI. What I want to do is, if a call comes in, the incoming telephone number and a picture are displayed, and, if I press a button, the incoming call will be accepted/answered.
Sadly, the code does not work. At first, an exception is thrown if I press my answer button:
ActivityNotFoundException: No Activity found to handle Intent {act=android.intent.action.ANSWER
Then I added an entry in the AndroidManifest.xml: I run the app again, there is no exception anymore. However, I doubt the incoming call is not really accepted. Because if the press the Android's screen answer button (green button), the incoming call is accepted and a green in call icon is also displayed on the upper left corner of the emulator screen, while my app doesn't.
I also read the Phone app's source code in android source. There is method such as acceptCall() in the Phone class. But these codes seem difficult for me to use, because there are many imports declaration in the code, such as :
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
And, if I add these imports in my code, there will be too many errors, such as : "The import com.android.internal.telephony cannot be resolved" What is the right and simple way for my problem?
View 1 Replies
Mar 11, 2014
I upgraded to KitKat 4.4.2 (Samsung Galaxy S4) and the "touch to answer" is enabled again.
How can I disable this? Even I have Easy Touch Mode "unchecked" it still answers only with tapping.
When I used Android 4.2.2 it was working fine. I don't want to use this !!!!
View 3 Replies
View Related
Nov 21, 2010
on my Xperia 10 after upgrading to OS 2.1, I lost the ability to press the on/off button on top to ignore a call which would also send it to any "forward when busy number".Anyone have a suggestion of what will do that now?
View 1 Replies
View Related
Sep 24, 2010
2.2 froyo OTA
rooted, virtuous 2.7 + custom kernal
setCPU with just screen off profile
It is very sporatic but happens quite frequently. Sometimes i will see an incoming call, hear the ringer, then when i click "Accept" it appears to be connected, but i hear dead silence. Then about 10 seconds later the call is ended. It may happen a few times in a row, and it also may not happen. I never have any issues dialing out though. I know the people calling me, and sometimes it is people who don't call regularly. They wouldn't play games like prank call me.
View 14 Replies
View Related
Jan 11, 2010
Sometimes when I get a phone call, I get the Accept / Decline Buttons on my phone. Other times, I don't get these options and only a choice to slide the screen to unlock to answer. This has been annoying, sometimes difficult to answer, and at times I have missed calls. I read in another post that I can simply click the: Green button / Red Button on the phone to answer or send to voicemail.
Question: Why is it that on some calls I get the Accept / Decline and on other calls I don't? I'm not sure if it has something to do with calls numbers matching my contact list vs. unknown numbers. Sometimes I get it, other times I don't. Is there a way to set my phone to get: Accept / Decline every time?
View 10 Replies
View Related
Aug 20, 2010
Hi. I am looking for some advice with regards to how I receive calls on my Xperia X10i. Basically, the story goes as follows...normally when I receive a call I have to do that swipe thing to accept the call, however, at very random times instead of the swipe I get the option of pressing 'Accept Call' or 'Decline Call' which are displayed on the lower part of the screen side-by-side. Now, to be perfectly honest I actually prefer the latter option but do not know why it is so random. To be clear, I have never updated my phone since I got it and I have searched the settings but not been able to locate anything which would explain this.
View 3 Replies
View Related
Nov 11, 2010
i have a nest button on clicking which a new image should be displayed.But not happening so i have taken an integer array as: private int imageCounter = 0; private int index_count = 0; private ImageView imageView; private int[] imageArray = {R.drawable.image_w_lbl_0, R.drawable.image_w_lbl_1,};
View 3 Replies
View Related
Feb 10, 2010
I want to redirect to particular URL while clicking on button
View 2 Replies
View Related
Sep 29, 2009
Is it possible to add an incoming call with current call to make it as a conference call programmatically?
View 2 Replies
View Related
Nov 22, 2010
I have a linearlayout that is filled with texviews dynamically when i click on a button , but the content of linearlayout doesn't appear, how can i redraw it?
View 2 Replies
View Related
Nov 17, 2010
in my android application there are number of images in drawable folder. in my layout two buttons: back and forward button.on clicking next and back buttons different-2 image get loaded on the same layout(common for all images). Problem:i am able to load images in next button click but as i click on back button no image got loaded.
View 3 Replies
View Related
Oct 9, 2010
How can we on or off GPS and 3G by clicking on button without going on setting screen in android?
View 1 Replies
View Related
Apr 25, 2010
Is there any way to make DatePickerDialog not dismiss after clicking set button ?
View 2 Replies
View Related
Nov 25, 2009
How to connect to email while clicking on button in android
View 2 Replies
View Related
Jan 25, 2010
how to disconnect the call(i.e incoming call) programmatically ?
View 3 Replies
View Related
Nov 24, 2010
I started a small android application to learn. I placed an input text and button on the screen. That shows on the emulator. After i press the button(which has an onClickListener) the application cracks and tells me on the screen of the emulator : "The application... has stopped unexpectably.Try again" and i have a "Force close", which of course closes the application.
I cleaned and rebuild the project a lot of times. i have no errors shown.(using eclipse)
this is the layout/main.xml code...
View 2 Replies
View Related
Dec 15, 2009
My app have a spinner and also have reset button. how to update the values while clicking on button?
View 1 Replies
View Related
Aug 13, 2010
If i click on a button on one layout it should add text view in another layout dynamically again if i click that button same procedure should get repeat.
View 1 Replies
View Related
Nov 18, 2010
I am working on an application where I need to go to the next Screen form the Main Actvity when I Click on the Image Button of the Main Activity Screen. I had searched a bit on Net regarding this and found something like the OnClickListener method. I am still stuck for what exactly I want to do actually.
View 3 Replies
View Related
Aug 2, 2010
When I'm on a call and a 2nd call comes in, my phone doesn't ring or anything. Is there anyway to change this so that I know when I have a call waiting without having to look at the screen (which is usually pressed up against my ear)?
View 1 Replies
View Related
Aug 7, 2010
I want to create call accept and reject buttons looks similar to default buttons and having functionality same pls. answer it
View 11 Replies
View Related
Feb 5, 2009
I have an application with main view having a search button. On clicking the search button, search results are displayed in a text view. When I hit the back button at this view, instead of navigating to the previous screen, application itself gets closed. Could anybody please let me know how to go back to previous screen.
View 14 Replies
View Related
Sep 29, 2010
How can we lock the current state of settings like wifi,gps,bluetooth,vibration,etc...after clicking on button1.and it should be unlock when button2 is pressed.
View 1 Replies
View Related
Dec 9, 2009
I would like to start MyActivity class when the user clicks on the search button on the handset.
Are there any strategies you can suggest for this? Any code examples would be very useful.
View 1 Replies
View Related
Nov 17, 2010
I want to create call accept and reject buttons looks similar to default buttons and having functionality same.
View 1 Replies
View Related
Nov 26, 2012
i need a way to understand that the incoming call is a forwarded call so i can deny it using tasker or another application.If possible i want to auto decline the call using tasker + secure settings or any other plugin
View 3 Replies
View Related
Aug 2, 2010
I'm beginning to study Android and have a doubt. How do I open a new layout and code (xml and java) by clicking a button on the main scene?
View 4 Replies
View Related
Apr 12, 2010
Double-clicking menu unlocks it, but if you are returning to the home screen, up pops the menu bar because then i have to click "back" to get rid of it.
View 6 Replies
View Related
Apr 18, 2013
I have to develop one android application.
Here is the scenario:There are many images in a linearlayout. When selected, the layout should be displayed with another(gradient_bg_hover.xml) background. This works well now.
Now, I would like that when I open a new activity and come back to this one, the last selected layout should still be the highlighted one (with the (gradient_bg_hover.xml) background).
Now i have used below code for highlighting the image when pressed:
[HIGH]
LinearLayout ar = new LinearLayout(this);
ar.setOrientation(LinearLayout.VERTICAL);
ar.setPadding(3, 3, 3, 3);
ar.setLayoutParams(artiLayoutParams);
ar.setGravity(Gravity.CENTER);
ar.setBackgroundColor(Color.parseColor("#666666")) ;
[Code]...
In OnClick function i have wrote the below code:
[HIGH]
private OnClickListener mArticleClick = new OnClickListener()
{
@Override
public void onClick ( View v )
{
int object = v.getId();
v.setSelected(true);
[Code]...
Here i have to clicked one item means it is go to next activity.afterthat i have clicked back button means the selected item is stay on highlighted with another background.afterthat i have selected another item means its go to next activity.now i have to click back button means these item only highlight with background....but the pervious item also highlighted....
I wish to need the o/p like :
The last selected item only highlighted after click the back button...
So i have used sharedpreferences :
I have declared int prevPosition = -1; globally...
[HIGH]
ar = new LinearLayout(this);
ar.setOrientation(LinearLayout.VERTICAL);
ar.setPadding(3, 3, 3, 3);
ar.setLayoutParams(artiLayoutParams);
ar.setGravity(Gravity.CENTER);
[Code]...
In Onclick method:
[HIGH]
private OnClickListener mArticleClick = new OnClickListener()
{
@Override
public void onClick ( View v )
{
int object = v.getId();
[Code]...
But my background color is not staying after press the back button...
View 1 Replies
View Related
Aug 19, 2010
How to open the ContextMenu in Android by Clicking a Button?
View 1 Replies
View Related