[android-developers] Re: Broadcast receiver in foreground activity - not reliable?

2013-03-12 Thread Piren
Not sure what's going on then... i suggest you add some logging to your activity and receiver and try to see what goes wrong... i'm guessing that when the app is in the foreground a different intent is being sent (maybe because they exit the car mode differently). Not familiar with these

[android-developers] Re: Broadcast receiver in foreground activity - not reliable?

2013-03-11 Thread Piren
in what lifecycle events do you register/unregister this receiver? On Sunday, March 10, 2013 4:25:37 PM UTC+2, lbendlin wrote: I got a user reporting that our app does correctly terminate when the user's device exits car mode, but only when the activity that contains the receiver is not

[android-developers] Re: Broadcast receiver in foreground activity - not reliable?

2013-03-11 Thread lbendlin
It is registered in onCreate and unregistered in onDestroy of that activity. On Monday, March 11, 2013 4:02:36 AM UTC-4, Piren wrote: in what lifecycle events do you register/unregister this receiver? On Sunday, March 10, 2013 4:25:37 PM UTC+2, lbendlin wrote: I got a user reporting that

[android-developers] Re: Broadcast receiver not working in ICS

2012-07-13 Thread Johan Appelgren
To request a permission you have to use the uses-permission element. http://developer.android.com/guide/topics/manifest/uses-permission-element.html What you have done is require that the sender of the BOOT_COMPLETED intent has been granted the RECEIVE_BOOT_COMPLETED permission. Don't think

[android-developers] Re: Broadcast receiver not working in ICS

2012-07-13 Thread Johan Appelgren
To request a permission you have to use the uses-permission element. http://developer.android.com/guide/topics/manifest/uses-permission-element.html What you have done is require that the sender of the BOOT_COMPLETED intent has been granted the RECEIVE_BOOT_COMPLETED permission. Don't think

[android-developers] Re: Broadcast receiver starts a new thread, do I need to kill it?

2012-07-04 Thread G. Blake Meike
If there's a reason to do this asynchronously, you should do it with an AsyncTask. On the other hand, I'm with Justin wondering why you want it done asynchronously, at all... G. Blake Meike Marakana The second edition of Programming Android is now on-line:

[android-developers] Re: Broadcast receiver receive empty extras

2012-04-19 Thread viktor
Didn't fix my problem, after a long time I still receive an empty Extras, it is on 2.1. On 18 Кві, 22:00, TreKing treking...@gmail.com wrote: On Wed, Apr 18, 2012 at 1:51 PM, viktor victor.scherb...@gmail.com wrote: Yes, I agree with but sometimes an Extras comes with Bundle[{}]; I don't

Re: [android-developers] Re: Broadcast receiver receive empty extras

2012-04-19 Thread TreKing
On Thu, Apr 19, 2012 at 3:04 AM, viktor victor.scherb...@gmail.com wrote: Didn't fix my problem, after a long time I still receive an empty Extras, it is on 2.1. You need to explain your problem better. Like what is a long time. What is different between these times?

[android-developers] Re: Broadcast receiver receive empty extras

2012-04-19 Thread viktor
I copy My trouble from another thread: I had a simple app that has Service and Application. Application starts Service by Action with Intent. The Service received Intent with onStartCommand and handle some action by key that is in Intent. Sometime Service receives empty Intent. public void

[android-developers] Re: Broadcast receiver receive empty extras

2012-04-18 Thread viktor
Sorry, it is problem with Service. this one: http://groups.google.com/group/android-developers/browse_thread/thread/f5c1f6af2914cde6 On 18 Кві, 18:14, Justin Anderson magouyaw...@gmail.com wrote: What action are you receiving?  Is it your own custom action or one defined by Android?  If it is

[android-developers] Re: Broadcast receiver receive empty extras

2012-04-18 Thread viktor
Application: public void sendRequest(int type, Bundle data) { Intent i = new Intent(getLocalServiceAction()); data.putInt(LocalApiService.INTENT_NAME_REQUEST_ID, type); i.putExtras(data); ALLogger.log(Log.DEBUG, TAG, sendRequest,

Re: [android-developers] Re: Broadcast receiver receive empty extras

2012-04-18 Thread Justin Anderson
I don't really see anything wrong there... Have you tried this method? http://developer.android.com/reference/android/content/Intent.html#putExtra%28java.lang.String,%20android.os.Bundle%29 Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Wed, Apr 18,

[android-developers] Re: Broadcast receiver receive empty extras

2012-04-18 Thread viktor
Seems works with i.putExtra(LocalApiService.INTENT_EXTRA, data), thanks. What is the problem was? On 18 Кві, 20:03, Justin Anderson magouyaw...@gmail.com wrote: I don't really see anything wrong there...  Have you tried this

Re: [android-developers] Re: Broadcast receiver receive empty extras

2012-04-18 Thread TreKing
On Wed, Apr 18, 2012 at 1:24 PM, viktor victor.scherb...@gmail.com wrote: Seems works with i.putExtra(LocalApiService.INTENT_EXTRA, data), thanks. What is the problem was? Originally, you were putting the int in the bundle, then the bundle in the intent. On receipt, you were trying to get

[android-developers] Re: Broadcast receiver receive empty extras

2012-04-18 Thread viktor
Yes, I agree with but sometimes an Extras comes with Bundle[{}]; You also can take a look to this thread: http://groups.google.com/group/android-developers/browse_thread/threa... On 18 Кві, 21:36, TreKing treking...@gmail.com wrote: On Wed, Apr 18, 2012 at 1:24 PM, viktor

Re: [android-developers] Re: Broadcast receiver receive empty extras

2012-04-18 Thread Justin Anderson
Originally, you were putting the int in the bundle, then the bundle in the intent. On receipt, you were trying to get the data from the intent. Wow... can't believe I missed that. Woops! Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Wed, Apr 18,

Re: [android-developers] Re: Broadcast receiver receive empty extras

2012-04-18 Thread TreKing
On Wed, Apr 18, 2012 at 1:51 PM, viktor victor.scherb...@gmail.com wrote: Yes, I agree with but sometimes an Extras comes with Bundle[{}]; I don't know what that means. You also can take a look to this thread: http://groups.google.com/group/android-developers/browse_thread/threa... Your

[android-developers] Re: Broadcast receiver won't receive camera event!

2012-03-28 Thread Alik Elzin
The action com.android.camera.NEW_PICTURE is not documented. Why should it work on different devices? On Saturday, January 1, 2011 6:46:54 PM UTC+2, androidman wrote: Hi, I'm trying to make an app that detects when a user takes a photo. I set up a broadcast receiver class and registered it in

[android-developers] Re: Broadcast receiver execution.

2012-03-26 Thread Ali Chousein
For anything which works asynchronously (BroadcastReceivers work asynchronously) I wouldn't make any assumptions that you are going to receive messages in order. - Ali Chousein http://socialnav.blogspot.com | http://twitter.com/socialnav1

[android-developers] Re: Broadcast receiver execution.

2012-03-26 Thread Put_tiMe
Hmm, that is actually quite surprising to me. Especially if I want to do something on screen-on and off. So in the above case, if I get the intents in this order Off, On, On, Off instead of the right sequence Off, On, Off, On, then all my logic will go horribly wrong. Are you sure about

Re: [android-developers] Re: Broadcast receiver execution.

2012-03-26 Thread Mark Murphy
On Mon, Mar 26, 2012 at 5:00 AM, Put_tiMe putt...@gmail.com wrote: Are you sure about the system intents being delivered not in the sequence they were generated? AFAIK, there is nothing in the documentation that guarantees the delivery order for events like this. Hence, it is risky to assume a

[android-developers] Re: Broadcast Receiver inside a library project

2012-03-13 Thread Brett
Thanks Mark, that's what I figured. On Mar 13, 12:50 pm, Mark Murphy mmur...@commonsware.com wrote: On Tue, Mar 13, 2012 at 3:42 PM, Brett bnotting...@gmail.com wrote: It looks like unless I declare in project B's manifest to register the receiver in project A that it won't work. Correct.

[android-developers] Re: Broadcast Receiver issue

2012-02-23 Thread brian lee
So, just so I understand this correctly. I will need two classes, one the broadcastreciever and the other the service. The broadcastreciever will listen for the boot complete to start the service. The service will then listen for the headset broadcast and pass that back to the broadcastreciever

[android-developers] Re: Broadcast receiver Activity is in foreground or stop.

2011-10-21 Thread Anieeh
Thanx Ali For your quick reply I have tried this in different way i.e. i am putting one boolean variable called isAppInFront in Application extended class and i am keep on updating this variable form onStart() and onStop() method but the problem is as i have said i have many activity so

[android-developers] Re: Broadcast receiver Activity is in foreground or stop.

2011-10-20 Thread Ali Chousein
You know when onPause()-OnStop()-onDestroy() of your activities are called. Inside one of these methods write your state to permanent storage (e.g. DB, shared preferences, even plain text file, you name it). Later on you can read which state you are in from permanent storage. I don't know if there

[android-developers] Re: Broadcast Receiver From Widget

2011-02-24 Thread Nguyen Dat
Dear Henry, This is result after investigate this problem, i was handler successful this issue. So i collect as report to share with android developer. Hope it help Here is result: ★Issue: Regarding limited from Widget, when try to register BroadcastReceiver via explicit source code: (No effect

Re: [android-developers] Re: Broadcast Receiver From Widget

2011-02-24 Thread Nguyen Dat
Dear all Sorry for missing report relate with Target environment for this report, just add item *7★Target Environment, **8★Notes* - Dear Henry, This is result after investigate this problem, i was handler successful this issue.

[android-developers] Re: broadcast receiver priority question

2010-10-25 Thread kevindroid
anyone has any idea? On Oct 24, 6:33 pm, kevindroid kevin.wang...@gmail.com wrote: the symptom: I have a broadcast receiver that listen to sms, when a sms is received, i call an activity to display. It works all fine if the screen is on and not locked. But when screen is locked, and as soon

[android-developers] Re: broadcast receiver issue

2010-07-23 Thread Kumar Bibek
You have to register the receivers in each of the activities. -Kumar Bibek http://tech-droid.blogspot.com On Jul 23, 11:12 am, Sandeep sandeep.phanse...@gmail.com wrote: Hi All, I am working on one project where i am using broadcast receiver in one of my activity to capture the incomming

Re: [android-developers] Re: broadcast receiver issue

2010-07-23 Thread Agus
no, just declare your receiver in the manifest. On Fri, Jul 23, 2010 at 12:40 AM, Kumar Bibek coomar@gmail.com wrote: You have to register the receivers in each of the activities. -Kumar Bibek http://tech-droid.blogspot.com On Jul 23, 11:12 am, Sandeep sandeep.phanse...@gmail.com wrote:

Re: [android-developers] Re: broadcast receiver issue

2010-07-23 Thread Sandeep Phansekar
thanks All [?] @Agus : can u plz expalin me how to do that in my project there are 5 classes -- 4 class file extend *Activity* -- mainly they display user interaction screen -- 1 class file extends *BroadcastReceiver -- *capture the incomming call and display/ launch the one of the activity. --

[android-developers] Re: broadcast receiver issue

2010-07-23 Thread Kumar Bibek
Even if you declare the receiver in the manifest, you have to register that receiver in each of your activities if you want to receive specific intents. Declaring only in the manifest just ensures that your receiver gets called, but it wont pass on that broadcast to your Activities unless you

[android-developers] Re: Broadcast receiver, service thread

2010-06-24 Thread Federico Paolinelli
Thanks again a lot for your replies. On 24 Giu, 01:31, Mark Murphy mmur...@commonsware.com wrote: On Wed, Jun 23, 2010 at 7:24 PM, Federico Paolinelli fedep...@gmail.com wrote: If I understood correctly, I need to bind to the service in order to provide it a listener, and then if I want to

[android-developers] Re: Broadcast receiver, service thread

2010-06-23 Thread Federico Paolinelli
First of all, many thanks for the quick reply. On 24 Giu, 01:00, Mark Murphy mmur...@commonsware.com wrote: On Wed, Jun 23, 2010 at 6:50 PM, Federico Paolinelli fedep...@gmail.com wrote: Every single intent produces an action to be performed. Now the first question: should I start a

Re: [android-developers] Re: Broadcast receiver, service thread

2010-06-23 Thread Mark Murphy
On Wed, Jun 23, 2010 at 7:24 PM, Federico Paolinelli fedep...@gmail.com wrote: If I understood correctly, I need to bind to the service in order to provide it a listener, and then if I want to use the onProgressUpdate for an AsyncTask started from the service, I should notify the listener from

[android-developers] Re: Broadcast Receiver without Activity.

2010-02-14 Thread askPrins
Rogerio, What do you mean by using a service instead? Should the service initiate the receiver, e.g. using registerreceiver() ? On Feb 12, 9:35 pm, Rogério de Souza Moraes rogerio.so...@gmail.com wrote: Hi askPrins, you can implement this using a service class instead of an activity class.

Re: [android-developers] Re: Broadcast Receiver without Activity.

2010-02-14 Thread Dianne Hackborn
Please don't keep a service running just to register a receiver...! Publish the receiver in your manifest, so that the system will launch your app when needed and not have to keep it running all of the time. On Sun, Feb 14, 2010 at 3:44 AM, askPrins askpr...@gmail.com wrote: Rogerio, What do

[android-developers] Re: Broadcast Receiver and Remote Service

2010-01-20 Thread Natalie
Thanks for the response. I'm pretty sure that's not it because I've put a debug statement first off in the broadcast receiver's onReceive method and that isn't appearing either. It almost seems that the activity's thread just isn't getting switched to - so far I've only tested in the emulator,

[android-developers] Re: Broadcast Receiver and Remote Service

2010-01-20 Thread jotobjects
Hi Natalie - Not sure what you mean by service you spawned onto its own thread. In any case, it looks like the Service is going to be pretty busy in that while(1) loop so it is not too surprising that it is not available to process the showMessage call. :) Yes they are two different threads.

Re: [android-developers] Re: Broadcast Receiver and Remote Service

2010-01-20 Thread Dianne Hackborn
Also, you should consider having the client supply a callback interface instead of using a broadcast to communicate with it. The RemoteService includes this as part of its example. (And just to be sure -- do you -really- need a remote service? If there is no need for it to run in a separate

[android-developers] Re: Broadcast Receiver and Remote Service

2010-01-20 Thread Natalie
Thanks so much for the response. But if the long loop (which updates the field that needs to find its way to the activity) is in a different thread from the one that processes the showMessage call, won't I have to switch to doing the communication through the Handler? And at that point I'm

[android-developers] Re: Broadcast Receiver and Remote Service

2010-01-20 Thread Natalie
Hi Dianne, I initially had the service as a local service, but my application was getting Application Not Responding messages. Since I'll never have more than one application binding to my service, I think I'm just going to abandon the service approach and try the approach in the example

[android-developers] Re: Broadcast Receiver and Remote Service

2010-01-20 Thread jotobjects
The serviceHandler object you have there now doesn't seem to do anything useful. You just need to start the loop in a thread so it doesn't block the event loop for the Service. A complete redesign as Dianne suggests is probably better (and as you said maybe there is no reason for having a

[android-developers] Re: Broadcast Receiver and Remote Service

2010-01-20 Thread jotobjects
You are getting ANR because the service is in an infinite loop! Putting it in a remote service doesn't fix that. On Jan 20, 3:41 pm, Natalie natlinn...@gmail.com wrote: Hi Dianne, I initially had the service as a local service, but my application was getting Application Not Responding

[android-developers] Re: Broadcast Receiver and Remote Service

2010-01-20 Thread Natalie
Thanks for this advice - I changed 3 lines and now it works - turns out I was confused about the right way to go about starting my background thread. I'll probably move away from the Service implementation now, but it's great to have it working!! Thanks again everyone! On Jan 20, 3:44 pm,

Re: [android-developers] Re: Broadcast Receiver and Remote Service

2010-01-20 Thread Dianne Hackborn
A remote service is not the way to solve an ANR -- you are just moving the ANR into another process (and hiding it because if that process isn't doing UI, it can still ANR when background requests are being made of it and in that case we just kill it rather than bothering the user). A Service is

[android-developers] Re: Broadcast Receiver not getting called when expected

2010-01-17 Thread DroidAttack
Hi, I have the same issue but I cannot seem to find a way to disconnect the connectivity on the emulator as you described in your solution. Can you please describe how this can be done. Thanks. On Dec 28 2009, 7:40 pm, Albert albert8...@googlemail.com wrote: solved! it appears that the emulator

[android-developers] Re: Broadcast Receiver not getting called when expected

2010-01-17 Thread Albert
If you long click the cancel call button on the emulator you will the phone options where you can set the airplane mode to on, that way you will receive the broadcast. Remmember when you test this that the emulator is actually using your computer's network so you will need to disable that as well.

[android-developers] Re: Broadcast Receiver works sometimes/sometimes not.

2010-01-06 Thread jwei512
I'm pretty sure it's because in the manifest, if the package is com.test then when you declare Activities/Services/Receivers the package name is already assumed... so if you do: receiver android:name=.BootBroadcastReceiver android:enabled=true Then this is actually

[android-developers] Re: Broadcast Receiver not getting called when expected

2009-12-28 Thread Albert
solved! it appears that the emulator would not send the broadcast only by not being connected, you also have to disconect it on the emulator. Maybe in the future releases it will be better sync with the pc... -- You received this message because you are subscribed to the Google Groups Android

[android-developers] Re: broadcast Receiver for action android.intent.action.MAIN

2009-10-03 Thread RichardC
Try adding category android:name=android.intent.category.DEFAULT / to the receiver intent-filter. I don't think this will work but I am interested to see what result you get :) -- RichardC On Oct 3, 12:38 pm, jonathan.duty jonathan.d...@gmail.com wrote: I was wondering if its possible to

[android-developers] Re: broadcast Receiver for action android.intent.action.MAIN

2009-10-03 Thread Mark Murphy
I was wondering if its possible to have a broadcast receiver to listen when the app its in launches. I tried doing by creating a BroadcastReceiver to listen for the android.intent.action.MAIN action but it never gets called? Is there something I need to do or a different action I should be

[android-developers] Re: Broadcast receiver

2009-09-28 Thread Mark Murphy
richarth wrote: Hi, I'm trying to create a broadcast receiver which responds to system events and change system settings. I don't need any interaction from the user so I don't need an activity and have been trying to do everything through the manifest file. I've put a log event into my