Thanks a lot Mark, Dianne and Walter. We ended up having to call
pendingIntent.send() before the call to
remoteView.setOnClickPendingIntent() in the handleButtonAction()
method.  That works, although it seems like the remote view should be
responsible for sending the pending intent.

Thanks again!
Clark

On Dec 22, 6:12 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> ClarkBattle wrote:
> > The other developer is sitting right next to me.  Its the same
> > company.
>
> Well, that certainly simplifies matters... :-)
>
> > He just implemented an intent-filter in his manifest to listen for an
> > action called "com.poof.intent.action.MovieApp"
>
> Does his <intent-filter> have anything else? For these sorts of things,
> I usually just have the <action> element in the filter and nothing else.
> You don't need a category or anything, and they can actually get in the
> way a bit. For example, if his <intent-filter> has a category, you'll
> need that category in your Intent as well, AFAIK.
>
> > I changed my code to
>
> > Intent intent = new Intent( "com.poof.intent.action.MovieApp" );
> > intent.putExtra("FILENAME", MOVIES[state.currentMovie].filename);
> > PendingIntent pendingIntent = PendingIntent.getActivity( context, 0,
> > intent, PendingIntent.FLAG_UPDATE_CURRENT );
> > remoteView.setOnClickPendingIntent( R.id.btnDoIt, pendingIntent );
>
> > And updated his apk on my emulator.  The button still does nothing.
> > Any ideas?  Examples?
>
> Well, assuming his <intent-filter> is just the <action>, that should be
> fine. Are you seeing any warnings in LogCat? If Android can't find a
> match on the Intent, it'll toss out a warning, not an error.
>
> Also, you could toss together a scrap project and call a regular
> startActivity() in there on the Intent, to see if that launches. That'll
> tell you if your problem is in the Intent construction or in the app
> widget proper.
>
> In terms of an example, here's one where I am starting up the browser on
> a URL:
>
> Intent i=new Intent(Intent.ACTION_VIEW, Uri.parse(c.getString(1)));
> PendingIntent pi=PendingIntent.getActivity(this, 0, i, 0);
>
> updateViews.setOnClickPendingIntent(R.id.title, pi);
> updateViews.setOnClickPendingIntent(R.id.panel, pi);
>
> In this case, I am using the same PendingIntent on two views in the app
> widget, because the title itself (a TextView) is kinda thin and
> difficult to tap, so I have the panel (a layout) behind it also respond
> to a click to provide a larger target. Also, c.getString(1) is pulling a
> String URL value out of a Cursor.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android App Developer Training:http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to