Android :: Phone State Listener Events Stop Receiving Sometime
Jan 21, 2010
My application process incoming/outgoing calls and shows some UI. So I use PhoneState Listener to listen changes such as CALL_STATE_IDLE , CALL_STATE_RINGING ,CALL_ STATE_ OFFHOOK. on receiving call to my BroacastReceiver for incoming/outgoing call. Most of the time things work properly. But sometimes my application does not receive events of Phone State Listener and hence it is not able to change/clear UI.From user feedback this typically occurs on HTC Hero. But I have came across this issue sometime on other devices also.My first guess is that android is killing my application in midway during call due to memory requirement. If so, is there any way to ensure that android does not my kill application under such situation .
View 1 Replies
Feb 8, 2009
I'm a little confused by what I'm seeing with regards to phone state transitions via the PhoneStateListener. When I receive a call, this is what happens: (call comes in) RINGING -> IDLE (I pick up) OFFHOOK (I hang up) IDLE It's that first transition from RINGING to IDLE without any interaction from me (not ending the call, not answering the call) that confuses me. Do I really have to implement an idle counter to know that an incoming call has really ended? Seems like the reported phone state represents some sort of phone state that isn't the obvious one.Is this a bug or am I just not in tune with the paradigm here?
View 2 Replies
View Related
Sep 8, 2009
There appears to be a leak when using PhoneStateListeners. The following code simply reigsters in onResume and unregisters in onPause a PhoneStateListener. Repeatedly launch then press BACK (so the app is finished & onDestory is called before the next launch) and the number of activities reported by meminfo will equal the number of launches. For instance, here is the output I get after launching (and finishing) 11 times in sequence:
dumpsys meminfo com.example.leak Currently running services: meminfo
DUMP OF SERVICE meminfo: Applications Memory Usage (kB): Uptime: 12204322 Realtime: 12204322
** MEMINFO in pid 1358 [com.example.leak] ** native dalvik other total size:
2648 3079 N/A 5727
allocated: 2604 2254 N/A 4858
free: 43 825 N/A 868
(Pss): 913 1305 1475 3693
(shared dirty): 1080 3864 568 5512
(priv dirty): 808 936 1056 2800
Objects Views: 77
ViewRoots: AppContexts: 12
Activities: 11
Assets: 2
AssetManagers: 2
Local Binders: 36
Proxy Binders: 21
Death Recipients: 0
OpenSSL Sockets: 0
SQL heap: 0
dbFiles: 0
numPagers: 0
inactivePageKB: 0
activePageKB: 0 #
Without the PhoneStateListener, the number of activities is always 1 no matter how many times the app is launched & finished. So, am I doing anything wrong here? Or is this a bug in the TelephonyManager?
Here's the code package com.example.leak;
import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.util.Log;
public class LeakExample extends Activity {
private class MyPhoneStateListener extends PhoneStateListener {
@Override public void onCallStateChanged(int state, String incomingNumber) {
if ((state == TelephonyManager.CALL_STATE_RINGING)
|| (state == TelephonyManager.CALL_STATE_OFFHOOK)) {
LeakExample.this.finish();
} } }
MyPhoneStateListener phone_listener = new MyPhoneStateListener();
TelephonyManager telMgr ;
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
telMgr = (TelephonyManager) getSystemService (Context.TELEPHONY_SERVICE);
} @Override protected void onPause() { super.onPause();
telMgr.listen(phone_listener, PhoneStateListener.LISTEN_NONE);
} @Override protected void onResume() { super.onResume();
telMgr.listen(phone_listener, PhoneStateListener.LISTEN_CALL_STATE);
} @Override protected void onDestroy() { super.onDestroy();
Log.v("LEAK EXAMPLE", "onDestory");
}
View 3 Replies
View Related
Sep 7, 2010
I would like to know what are the main differences between TelephonyManager and PhoneStateListener, because you can do (more or less) the same things with both. For example, you could create an incoming calls register implementing a broadcastreceiver and using TelephonyManger API or extending PhoneStateListener class and registering this new listener throughTelephonyManager . Case 1 - BroadcastReceiver (TelephonyManager)
View 13 Replies
View Related
Mar 19, 2010
I have built an application that listen to call state changes, and I want to notify a service when the call_state became IDLE.All the components I have are functional, I just need to notify (not start) a service for this.What's the correct practice, maybe using AIDL? Because, in a PhoneStateListener, I can't bind to a service. Do I have to start an activity for that?
View 2 Replies
View Related
Nov 11, 2009
I have a BroadcastReceiver that listens for the BOOT_COMPLETED, that part works I know because I disabled my phone listener and displayed a Toast within. That BroadcastReceiver is supposed to start a service, that also works. I run into Force Close issues when my service attempts to tell my TelephonyManager to listen. Any one have any ideas? Here is my code StartSeviceAtStartUp.java import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent;
View 3 Replies
View Related
Nov 17, 2009
i've registered a PhoneStateListener in BOOT_COMPLETED receiver by using following call: tm.listen(new TestCallStateListener(), PhoneStateListener. LISTEN_ CALL _STATE); If the application crashes then system automatically unregisters the PhoneStateListener. Is there any mechanism of checking if particular PhoneStateLister is registered or not? Actually i'm thinking of starting a repeating service by AlarmManager which will check if PhoneStateListener is registered or not . And if it's not registered then service will register it again. Just a backup if application crashes. Is this a good approach or there is some better mechanism to make sure that PhoneStateListener is always registered even if application crashes ?
View 2 Replies
View Related
Aug 13, 2009
Basically I have handle the volume UP/DOWN key events when device in key lock state. How I can do this?
View 2 Replies
View Related
Jul 27, 2010
My sprint HTC hero for some reason will all the sudden stop allowing me to get text messages and mine that I send don't seem to reach the phone I am sending it to. It will stop working out of the blue and start back up. The only reason I know that it stops is because the person I am texting shows me that they never received a message from me and I never got one from them. My phone does not tell me I cant receive or send it just stops and I never know. When it starts working again it does not ever send the messages I didn't receive.
View 6 Replies
View Related
Jul 5, 2010
I have a Moto Droid and just recently it stopped receiving e-mails (I assume phone calls and texts, as well though I never tested). I have 2 Comcast POP3 emails setup on my phone to sync every 30 minutes. Randomly, the phone will stop receiving e-mails--I can't manually sync and end up having to turn the phone off and on (not pulling the battery) to receive e-mails again. This happened with my old BB too. Does anyone know of a reason why my phone stops functioning properly?
View 1 Replies
View Related
Jan 25, 2010
How can I make it so my eris makes no noise when receiving a text just vibrates?
View 3 Replies
View Related
Oct 2, 2010
I'm working on an Android class that extends MapActivity. I have set the OnTouchListener and everything works okay for the first MotionEvent. After the first MotionEvent, the system stops either generating MotionEvents or receiving them or both.
Does anybody know what I have to do to keep receiving MotionEvents?
CODE:............
View 1 Replies
View Related
Sep 8, 2010
I have a custom Android view which overrides onTouchEvent(MotionEvent) to handle horizontal scrolling of content within the view. However, when the ScrollView in which this is contained scrolls vertically, the custom view stops receiving touch events. Ideally what I want is for the custom view to continue receiving events so it can handle its own horizontal scrolling, while the containing view hierarchy deals with vertical scrolling.
Is there any way to continue receiving those motion events on scroll? If not, is there any other way to get the touch events I need?
View 1 Replies
View Related
Jan 17, 2010
I've looked pretty hard to find an answer to this but only found things about sending multiple page texts, not receiving. As a Verizon customer I loved being able to send and receive 7 page texts to and from other Verizon customers. I recently upgraded to an Eris from that horribly lousy Alias and noticed that when the same Verizon people send me multiple page texts, the Eris splits the texts up. I'm fine with it doing this, but the thing that really bothers me is every time I get a multiple page text from a Verizon user it also sends me (and the person sending the text) a notification saying the text had special formatting removed or something to that extent. Some people I talk to tend to send texts that are 2 or more pages every time and the constant notification can get really irritating. Is there an app or a workaround to prevent this?
View 2 Replies
View Related
Aug 6, 2010
I keep receiving a message from one of two numbers that i don't know. They always say KEEP THIS MESSAGE and then gives a IMEI number which is always the same. I don't want to reply to it and i just delete it but it is getting annoying now. Have installed Lookout but says my phone is clean.
View 6 Replies
View Related
Sep 18, 2010
How do I stop receiving message notifications while I am on a call.
View 1 Replies
View Related
Jul 31, 2010
When I first setup my Incredible, I signed on to Gmail. Whenever I receive an e-mail, I get two, one Gmail and one HTC. I dragged the HTC mail widget to the recycle bin. Than I went to manage applications and forced stop the HTC mail. This works until I power off the phone. Each time I boot it back up, I need to go to applications and choose forced stop. It is a small pain but still a pain. One is this happening to anyone else and second does anyone have a solution?
View 1 Replies
View Related
Apr 17, 2010
I installed handcent but when I get a text I am receiving two notifications one from handcent and one from the default how do I default it to notify me only on handcent?
View 2 Replies
View Related
Nov 30, 2009
When I send an e-mail from my Droid using my GMail account with the default GMail app, it sends me a copy of the e-mail. It does not do this with my other e-mail app. This is terribly annoying. I don't want a new e-mail of the e-mail I just sent in my inbox every time I send an e-mail. Is it possible to turn this off? I looked for a "reciept" option in the settings, but found nothing. The other e-mail app does not do this for my non-gmail accounts.
View 3 Replies
View Related
Oct 4, 2010
Since 2.2 upgrade if I do not open or delete any email in my in box I keep receiving new notifications on every refresh. Prior to upgrade one an email was downloaded from the pop3 server there would be no subsequent notifications. What can I do.
View 2 Replies
View Related
Nov 7, 2010
I've come across an interesting issue and thought I'd run it by the forum. I did a search before posting and didn't see anything about this. I'm going through my phone trying to free up some space. I use Uninstaller Pro to delete apps. Today I noticed that Google Maps is listed four times in Uninstaller Pro. Each one has the same version number and the same download date. I don't want to uninstall the program completely, but if it has somehow installed itself three extra times, I'd like to remove the copies. Root Explorer only lists the .apk one time Has anyone else had this problem or know of a reason why there would be four copies of Google Maps listed?
View 5 Replies
View Related
Aug 5, 2010
I've had my X10 mini pro for about a month and now I can't stand some of the "features" anymore. First, I thought people where crazy, sending me the same sms two or three times in a row. But now I've realized that they aren't, it's just my phone that receives them over and over again. It is the same thing with notifications. If I set a reminder in the calendar, the reminder pops up in my notification bar sometimes five or six times before I get to angry and delete the whole event from the calendar. Is these problems specific to me or do anyone else recognize them?
View 2 Replies
View Related
Sep 25, 2010
When receiving a call, there is a recorded voice that says "Call from xxxxx". How do you turn that off. It seems that it started with 2.2, but I'm not sure.
View 1 Replies
View Related
May 20, 2012
how to stop the vibration when receiving calls on galaxy nexus ...
View 9 Replies
View Related
Jan 23, 2010
How do you stop receiving notifications from the stock message app when using handcent
View 1 Replies
View Related
Nov 8, 2010
I have got 2 private messages through this forum that are clearly spam, that have nothing to do with my phone. How do I stop it?
View 4 Replies
View Related
Aug 25, 2010
I have Google and Roger email account set up on my phone. Is there a way to stop receiving spam emails when retrieving email from these accounts?
View 1 Replies
View Related
Aug 11, 2010
I have a compound UI component built up from a ViewGroup containing a number of TextView, ImageView etc. components. Many of these have StateListDrawables as their images/backgrounds. Is there any way of making them select from this drawable based on the state of the parent ViewGroup rather than the component itself? Ideally I want to be able to change the visual state of all children of the ViewGroup (text colour, image etc) based on the state of the ViewGroup, preferably without having to hook up complex logical code. This seems like a fairly common sort of requirement, so I was hoping it would be straightforward in Android - am I going to be disappointed?
View 1 Replies
View Related
Aug 30, 2010
I am writing an app where I get all the data from the rest call and display all the data in a custom component list(based on Linear Layout) which is added to a LinearLayout. I write this code in onCreate of the activity. The problem is when I switch activity using startActivity, and come back to the calling activity (using startActivity) then onCreate is called again. I see onPause, onStop called when I call other activity. Is there any way that I can save the application's state?
View 1 Replies
View Related
Jun 29, 2010
I was just working on an application that will do stuff when a call is missed or made; and am left wondering why do you have to register a listener using a long lived background service for phone state changes instead of being able to use broadcast intents?
View 2 Replies
View Related