Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old March 16th, 2010, 10:52 AM   #1 (permalink)
New Member
 
Join Date: Mar 2010
Posts: 6
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default start acticity from widget

I' m trying to launch an activity while clicking on the screen widget.
I've found a way that the click on the screen widget launches the browser using pending intents.
I've tried using something like this, but it doesn't work.
Code:
 Intent defineIntent = new Intent(this,myActivityClass.class);
                PendingIntent pendingIntent = PendingIntent.getActivity(/*context,*/this,
                        0 /* no requestCode */, defineIntent, 0 /* no flags */);
                updateViews.setOnClickPendingIntent(R.id.widget, pendingIntent);
Any ideas of what should I look for?

plusmoDroid is offline  
Reply With Quote
Sponsors
Old March 16th, 2010, 03:58 PM   #2 (permalink)
Junior Member
 
Join Date: Sep 2009
Location: San Francisco, CA
Posts: 49
 
Device(s): HTC EVO 3D
Thanks: 5
Thanked 5 Times in 4 Posts
Default

You need to pass a flag in the call to get the intent when starting an activity from a broadcast receiver like an app widget. Had this same problem a few weeks ago and while the docs for the flags are very obvious about having to pass one, you have to be looking at that part of the docs to see them.
tdieckman is offline  
Last edited by tdieckman; March 16th, 2010 at 04:00 PM.
Reply With Quote
The Following User Says Thank You to tdieckman For This Useful Post:
plusmoDroid (March 17th, 2010)
Old March 17th, 2010, 06:53 AM   #3 (permalink)
New Member
 
Join Date: Mar 2010
Posts: 6
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I searched the flags, and it worked!
Thanks a lot for your help!
plusmoDroid is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[WIDGET] piBalance—widget for tracking your bill balance, needs beta-users at different countries pilgr Alpha & Beta Testing 1 December 17th, 2010 05:28 PM
Any call log widget/voicemail widget looking like mail widget? Phantom1275 HTC Desire 2 September 26th, 2010 07:43 PM
auto start app to start apps on boot? xxwckdxx Android Applications 3 August 19th, 2010 10:20 PM
Widget for Lockscreen(Widget Locker) date/time/battery info? MrDonBonJovi Android Applications 0 August 19th, 2010 11:35 AM
Xbox Live Avatar Widget: Not a true widget, but a great contacts shortcut. Only Loki Application Reviews 0 June 13th, 2010 12:56 AM



All times are GMT -5. The time now is 10:20 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo


SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.