I had declare the class as static , but it's useless.

The most important is how to send message to Activity in
IntentReceiver.
Otherwise, if an IntentReceiver receive an Intent, how to tell
Activity there are some Intent received?


On 4月15日, 下午3时13分, f c <[EMAIL PROTECTED]> wrote:
> I think the issue with the above is that your MyIntentReceiver class
> would need to be declared static (if it were to work at all). Of
> course, when you do that, you won't be able to access foo().
>
> On Apr 14, 11:30 pm, Macro <[EMAIL PROTECTED]> wrote:
>
>
>
> > I had try to use AIDL, but while call Context.bindService in
> > IntentReceiver , there is a error dialog said cann't bind service in
> > IntentReceiver.
> > How to communicate between IntentReceiver and Activity?
>
> > I had tried use Inner-class , such as :
> > --code--
> > public class TestActivity extends Activity
> > {
> >          void foo()
> >          {
> >                 do something...
> >          }
>
> >         Class MyIntentReceiver extends IntentReceiver
> >         {
> >         public void onReceiveIntent(Context context, Intent intent)
> >         {
> >                  foo();
> >         }
> >         }
>
> > }
>
> > --code--
> > AndroidMainfest.xml:
> > receiver android:name="android.TestActivity.MyIntentReceiver">
> >                 <intent-filter>
> >                 <action
> > android:name="android.provider.Telephony.SMS_RECEIVED" />
> > </intent-filter>
>
> > But it's useless. That's why?How to solve it?- 隐藏被引用文字 -
>
> - 显示引用的文字 -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to