Android :: Intent And Extras - Set PendingIntent On A Notification

Nov 23, 2010

I set an PendingIntent on a Notification (notification.setLatestEventInfo). this intent is actually the same intent used to launch my app, only with a flag that I put in the extra (intent.putExtra(TAB_INDEX_PARAM_NAME, UPDATES_TAB_INDEX)).

So my first activity launches, it queries it's intent's extras and immediately navigates to an Alerts activity rather the normal activity on a regular launch.

The problem: from this point, every activation of my app navigates to this Alerts activity. when debugged, I find that the flag is "stuck" in the intent even though I removed/changed it. it just won't change.

How can change an extra on a giving Intent?

Android :: Intent and extras - set PendingIntent on a Notification


Android :: Why PendingIntent Doesn't Send Back My Custom Extras Setup For Intent

Jun 27, 2010

This questions somehow relates to the question when I was looking to get the extras back in startActivityForResult but now I face another challenge.

I have subscribed to receive ProximityAlerts and I have explicitly constructed the Intent to include some Extras. But when I got the service the extras are not there.

After the answers here is the working code:

CODE:..........................

The documentation says param PendingIntent to be sent for each location update.

View 2 Replies View Related

Android : Get A Parcel From Intent's Extras?

Sep 16, 2010

I've implemented parcelable on a class of mine per the doc instructions, works fine: code...

but I haven't implemented a copy constructor. However, the createFromParcel() method which I did implement is almost like a copy constructor. I'm wondering if I can use it make a copy, but I can't figure out how to get a Parcel instance from the intent extras:

MyParcelable mp2 = MyParcelable.CREATOR.createFromParcel(getIntent().getExtras().getParcelable("key"));// ? just need a parcel ?

it's not the greatest idea, just wondering if it's possible to avoid making another method for my class which will almost be identical to what's already implemented for the Parcelable interface..

View 2 Replies View Related

Android : Put Extras To Intent From Preferences?

Jan 17, 2010

I'm launching activity from preferences screen. Activity is shared among three preferences.
I wonder if i can set extras for this activity in xml. code...

All i need to do to pass an integer really. I can different actions and check action instead of extras.

View 5 Replies View Related

Android :: Is There A Limit On Extras Inside An Intent?

May 20, 2009

- Hide quoted text -

View 2 Replies View Related

Android :: How To Get Location Information From Intent Bundle Extras?

Jan 2, 2010

I am trying to use Android's LocationManager requestLocationUpdates. Everything is working until I try to extract the actual location object that in my broadcast receiver. Do I need to specifically define the "extras" to my custom intent so that the Android LocationManager before I pass it to requestLocationUpdates so it knows how to add it into the intent, or will it create the extras-bundle regardless when it passes the fired intent to the broadcast receiver?

View 1 Replies View Related

Android :: How To Declare Pending Intent That Keeps Fresh Extras?

Jun 29, 2010

A few days ago I was struggling to find a way to use custom intents for my alarms. Although I got clear answer that I have to customize the Intents based on some unique ID eg. setAction() still have some problems.This can happen more than once for a contact. And when the second message is generated, the notification is raised well (message is fine there) but the intent when the user actions the notification it uses old data, so previous message is passed and not the brand new message.So someway the intent is caching and reusing previous extras. How can I make it unique per contact and per action?

View 3 Replies View Related

Android :: Way To Catch Intent's Extras If Activity Is Already Running

Mar 4, 2010

I put a notification in the status bar with a PendingIntent (with Extras info) that points to my main app (main activity). When the user clicks the staus bar, the PendingIntent is fired and my app launches and I can read the Extras info in my onCreate() method. So far so good.

But if my app is already running, the PendingIntent simply causes the app to come to the foreground and it does not call any of my methods, so I can't read the content in Extras. What can I do?

View 1 Replies View Related

Android :: How To Clear Notification When Using PendingIntent?

Feb 10, 2009

I am wondering how you would cancel a notification when you are not the party executing the associated Intent.For example, think about an Intent like ACTION_VIEW and a data/url like http://google.com. This intent is then wrapped into a PendingNotification and used by a notification. So when the user clicks on the notification the intent is fired, the browser opens, but the notification is not cancelled. As my code is not the receiver of the Intent how should I cancel it?

View 3 Replies View Related

Android :: Return Value For A PendingIntent Launched Via A Notification

Apr 16, 2010

Is is possible to get back a result intent when launching an Intent from a Notification? Similar to the way startActivityForResult() works ?

View 3 Replies View Related

Android :: PendingIntent From Notification And Application History Conflicts

Mar 29, 2010

I'm creating a notification with something similar to the following:

CODE:............

The key here is the extra data on the Intent for the notification. Once I click on the notification and it brings up SomeActivity, it brings up the activity and the extra data is available.

However, if I exit the app, hold the home button until the recent activities list comes up, and choose to open the app again, the extra data is still passed. Is there a way I can make this data get passed only if the app is opened via the Notification, and not from the recent activities list?

View 2 Replies View Related

Android :: Notification Intent To Clear It Self

Aug 13, 2010

I have read many examples of how to create notification messages.What i wanted to achieve, is because the notification will be executed by a widget, i would like the notification intent when clicked to clear it self when the user clicks on it.I do not have an activity to return to.The notification for my purposes will just plainly notify, nothing else.So what would be the code of an intent that just clear/cancel itself.The code below is an activity launched by a button(button code not included) the notification will be fired up by a background service.

View 2 Replies View Related

Android :: Pending Intent Notification

Jun 9, 2010

I have a alarm thing going on in my app and it launches a notification that then when pressed launched an activity.The problem is that when I create more than one alarm then the activity launched from the notification gets the same extras as the first one. I think the problem is either with the intent i put in the pending intent or in the pending intent itself. I think I might need to put a flag on one of these but I dont know which one.The "details" extra is the same to every the next time a notification happens instead of having the different value.Until I set the intents I am sure that the correct value goes to the "details" so its a problem of getting the first intent everytime i press any notification. How can I make it to launch the correct intents?

View 2 Replies View Related

Android :: An Intent / Notification Of An App Start?

Feb 24, 2009

I would like to know, if i can register for an intent or a notification that i could get every time android starts an application.

View 2 Replies View Related

Android :: Make Notification That Does Not Call Intent?

Sep 23, 2010

I need to put a Notification in the Status bar while my app is running, but I don't want it to call back to my Activity if selected. Its meant to just be info to the user that the app is running - basically a reminder in case they press the home button and minimize it.

View 1 Replies View Related

Android :: How To Make Notification Intent Resume Rather Than Making New One?

Jul 22, 2010

What I have here is a simple webview activity that when loaded it auto displays an ongoing notification. The idea is that people can navigate away from this activity and quickly access it again from any screen they want by pulling down the drop down menu and selecting it. Then when they want they can just close the notification by hitting the menu button and hitting exit and then the notification clears. This all works fine. However, when the notification is pressed it starts a new instance of the activity. What would I have to change to make it see if the activity has not already been destroyed and I can just call that instance back(resume it) and therefore not needing to load it again and won't need to add another activity to my stack.

package com.my.app;
import com.flurry.android.FlurryAgent;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.webkit.CookieSyncManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;

public class Chat extends Activity {
private ProgressDialog progressBar;
public WebView webview;
private static final String TAG = "Main";
private NotificationManager mNotificationManager;
private int SIMPLE_NOTFICATION_ID;
@Override
public void onStart()
{ super.onStart();
CookieSyncManager.getInstance().sync();
FlurryAgent.onStartSession(this, "H9QGMRC46IPXB43GYWU1");
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.chat);
mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
final Notification notifyDetails = new Notification(R.drawable.chat_notification,"ChatStarted",System.currentTimeMillis());
notifyDetails.flags |= Notification.FLAG_ONGOING_EVENT;
Context context = getApplicationContext();
CharSequence contentTitle = "Chat";
CharSequence contentText = "Press to return to chat";
Intent notifyIntent = new Intent(context, Chat.class);
PendingIntent intent = PendingIntent.getActivity(Chat.this, 0;
notifyIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);
mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().startSync();
webview = (WebView) findViewById(R.id.webviewchat);
webview.setWebViewClient(new chatClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setPluginsEnabled(true);
webview.loadUrl("http://google.com");
progressBar = ProgressDialog.show(Chat.this, "", "Loading Chat...");
}
private class chatClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.i(TAG, "Processing webview url click...");
view.loadUrl(url);
return true;
} public void onPageFinished(WebView view, String url) {
Log.i(TAG, "Finished loading URL: " +url);
if (progressBar.isShowing()) {
progressBar.dismiss();
} } }
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) {
webview.goBack();
return true;
} return super.onKeyDown(keyCode, event);
} @Override
public boolean onCreateOptionsMenu (Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.chatmenu, menu);
return true;
} @Override
public boolean onOptionsItemSelected (MenuItem item) {
switch (item.getItemId()) {
case R.id.home:
Intent a = new Intent(this, Home.class);
startActivity(a);
return true;
case R.id.closechat: mNotificationManager.cancel(SIMPLE_NOTFICATION_ID);Intent v = new Intent(this, Home.class);
startActivity(v);
return true;
} return false;
} public void onStop() { super.onStop();
CookieSyncManager.getInstance().sync();
FlurryAgent.onEndSession(this);
} } @Commonsware

Just to be sure I have it correct, is this what you were suggesting? I was a little worried about this line:
PendingIntent.getActivity(Chat.this, 0, notifyIntent, SIMPLE_NOTFICATION_ID);
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.chat);
mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
final Notification notifyDetails = new Notification(R.drawable.chat_notification,"ChatStarted",System.currentTimeMillis());
notifyDetails.flags |= Notification.FLAG_ONGOING_EVENT;
Context context = getApplicationContext();
CharSequence contentTitle = "Chat";
CharSequence contentText = "Press to return to chat";
Intent notifyIntent = new Intent(context, Chat.class);
PendingIntent intent =
PendingIntent.getActivity(Chat.this, 0, notifyIntent, SIMPLE_NOTFICATION_ID);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);
notifyIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().startSync();
webview = (WebView) findViewById(R.id.webviewchat);
webview.setWebViewClient(new chatClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setPluginsEnabled(true);
webview.loadUrl("http://google.com");
progressBar = ProgressDialog.show(Chat.this, "", "Loading Chat...");
}

View 1 Replies View Related

Android :: Intent.action.NOTIFICATION REMOVE Not Available On All Devices

Nov 12, 2010

I've got a receiver set up in my android application to catch android.intent.action.NOTIFICATION_REMOVE intents. On my Evo, it works fine - when a notification is cleared from the notification bar, I catch that event and can run some code. I tried running this on a Samsung Moment though, and it is never caught. So now I'm trying to figure out why, and I can't seem to find anything on Google about this intent action - and I set this code up a few months ago, so I don't remember where I even found this action, it doesn't seem to be in the API.

The evo is running 2.2, and the moment is running 2.1-update1, so I'm guessing that it's undocumented, and only available in 2.2. Is there any other way to catch an event that a notification has been cleared? Note that I'm not trying to cancel a notification that I put up, or trying to cancel another app's notification, just catch an event when a notification has been cleared.

Here's my receiver in AndroidManafest.xml:

CODE:....................

View 3 Replies View Related

Android :: Clicking On Notification In Status Bar Binds The Intent With Target Activity

Mar 25, 2010

I have created an activity which sends a number of notifications to status bar. Each notification contains an intent with a bundle.

Here is the code:

CODE:..............

When user clicks this notifications, I read the bundle string "action" and performs that action. Here is the code:

CODE:.................

Everything works as expected. But, when I minimize the app using "arrow" button on device and then press and hold home button and clicks on my app icon the application starts and performs the same last action which have been performed by clicking the last notification. I figured out that when we click the app icon the application starts with last intent triggered by the notification.

View 2 Replies View Related

Android :: Intent When User Receives Mail And To Cancel Gmail Notification?

Dec 2, 2009

Is it possible to get an intent when the user receives a mail and to cancel the gmail notification?

I want to filter some messages and I do not want to get notifications from them.

View 5 Replies View Related

Android :: Detect If The PendingIntent Already Exists Or Not

Jun 22, 2010

I used AlarmManager to set the pending intent.

I need to find out the state of the pending intent, in other word, is this pending intent working or not. Boz i may need to cancel this pending intent, but before canceling it i want to make sure it's active.

But i see no function in AlarmManager can read this status.

View 9 Replies View Related

Android :: PendingIntent Vs LocationListener On RequestLocationUpdates?

Jun 25, 2010

you can subscribe to requestLocationUpdates via two ways one by specifing a PendingIntent the other is by using a LocationListener. When is advised the one and when the other?

View 1 Replies View Related

Android :: PendingIntent Always Creates New Activity Instance?

May 21, 2010

My app consists of an Activity and a service that runs in the background. The service periodically checks a website for an alarm condition. When the service detects the alarm, it should put a user notification into the status bar. If the user clicks the notification, it should display the app's activity. If the activity is already running, that activity should become visible. If the activity is not currently running, it should be created.

However the notification created by my service *always* creates a new instance of the activity, whether the activity is currently running or not. How do I get the desirable behavior?

Here is my service pseudo-code:

CODE:...............

View 3 Replies View Related

Android :: Need Tutorial On Usage Of GPS Proximity Alerts With PendingIntent

Aug 5, 2009

Can anyone post some sample code or point me to a tutorial on usage of GPS proximity alerts with PendingIntent?

View 2 Replies View Related

Android :: Data Lost When Sending Bundle With PendingIntent To Broadcast Receiver

Sep 16, 2010

I am adding some basic alarm functionality to my program via the use of AlarmManager and a BroadcastReceiver class (named AReceiver.java). My problem is that the data I add to the bundle attached to the Intent creating the PendingIntent appears to be lost. The only bundle data I can access in the AReceiver class is a android.intent.extra.ALARM_COUNT=1. Here is the basic code in the main activity class creating the Intent, PendingIntent and the AlarmManager: [Code in main activity - Notepadv3]

Intent intent = new Intent(Notepadv3.this, AReceiver.class);
intent.putExtra("teststring","hello, passed string in Extra");
PendingIntent alarmIntent = PendingIntent.getBroadcast(this, pendingPeriodIntentId, intent, 0);
AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, timeOfNextPeriod.getTimeInMillis(), alarmIntent);..................

View 1 Replies View Related

HTC EVO 4G :: Costs Of Phone And Extras

Jul 31, 2010

I am currently on tmobile using a vibrant. The bugs with the vibrant are starting to bug me, and there is no where else to go to for tmobile. I am thinking about going to sprint for the EVO. I will have to figure out a way to get out of my tmobile contract, (hasn't been 14 days) if anyone wants to help me with ideas.
my main question is, is it true that you have to pay an extra $10 a month for the Evo? I don't have 4G in my area, do I still have to pay for it? What kind of deals can I get from sprint for a new contract? Can I keep my same number?

View 30 Replies View Related

Motorola Droid X :: Themes And Extras

Nov 9, 2010

This is a list of Themes and some Extra's for the Droid X.

The themes are listed by ROM compatibility. One's marked "Verified" will represent the ones the creator verified with me or it states in the creators post. If it does not say "verified" I used my digression. If something is wrong, don't shoot the messenger.

- If you find dead links or anything I am missing, please PM me.

- If a theme is listed under the wrong section PM me.

- If a theme works with other roms other then the section listed in, PM me and I will note it on that theme.

- If you have questions or issues regarding a theme, direct your question to that creators post.

- Updated 12/8/2010

- See my ROM section - HERE
================================================== =======

Themes for 2.2 Froyo 2.3.15 Deodexed Roms(if these themes work on other Roms PM ME and I will note it)

Creator: phimuskapsi
Vanilla Android
BlueSteel

Creator: drewden123 - Verified
Xtreme

Creator: D13 - Verified
NexTheme w/ Teenfaces statusbar

Creator: Webst3r
RedSteel
BrushedSteel
SenseX 2.2

Creator: 928 Droid
Black Glass X

Creator: bad4u6669 - Verified
Red Overload
Royal Blue

Creator: bignadad
BiG Droid X

Creator: Mike919
Purple Passion
Nex-TANG

Creator: Mrbobrowitz - Verified "Themes will work for any Blur/ Non Blur Rom"
Galaxy S
Drop Theme (Red)

Creator: Explodee
Froyo Dynamite

Creator: ULTRALINX
Minimal Matte - gotta pay for it

Creator: Krayzee - Verified
Droid X theme - he needs beta testers

Themes for Blur Roms

Creator: Fabolous - Verified
NexTheme
REVOlution R2

Creator: Team Incognito - Verified
Incognito Blurred Themes

Themes for Blur-less Roms

Creator: BBCrackman - Verified
BBC Dark Status Bar and Clear Lock Screen

Themes for Specific Roms

Creator: javroch - Verified
Black Out for Fission DX

Creator: Many Creators - Verified
Themes for the Fission Rom

Creator: Fabolous - Verified
NexTheme for ApeX
REVOlution for ApeX

Creator: Mrbobrowitz - Verified
Galaxy S for Tranquility

Creator: Bgill55 - Verified
Incognito Color Series For RubiX - link down

Creator: JsinLegacy and Rola - Verified
iX for rubiX Focused
Xpired for rubiX Focused- post#3
Sinful Series for rubiX Focused

Creator: Juicemane - Verified
Black Juice for rubiX Focused (2 color choices)
Blur Based Black Juice Theme for any Deodexed 2.2 rom
Black Juice for rubiX Blurry

Creator: Natemz - Verified
ProDX Red Theme for the Droid X (only tested on Tranquility 2.8)

Creator: BarracudaCM - Verified
Nebraska Theme /ColoredNebraska (Themes for: rubiX, FlyX, Fission, Tranquality and any roms)

Creator: Faber78 - Verified
KangeradeX for Fission

Creator: Joe722 - Verified
X v1.1.4 for Fission 2.0+

Ports By: Bjoe722 - Verified
NexTheme for Fission
Revolution Remix for Fission
Galaxy S for Fission
Revolution for Fission
Kangerade Blue for Fission

Creator: gregtard- Verified
DarkAndroid for rubiX Focused 1.9.3
Blue Droid Theme for rubiX Focused 1.8.6, 1.9.3, & 1.9.0 Leak/Non-Leak
DarkAndroid for Tranquility 3.5 & 3.5.1

Ported By: RoLa
Flavored Ice- Dark Berry Edition by Jairomeo for Rubix Focused

Creator: Team Incognito
Incognito Back bar mod for Ruibx Focused

Creator: ArmyRanger
Simple Black bar Mod For Blur Roms

Creator: Mrbobrowitz - Verified
Blackmodzz 2.0 - for ANY 2.2.1 Rom

Extras

Creator: bad4u6669
Themed Swype / stock keyboard

Creator: WJG
Droid X Modified Gallery

Creator: acidbath5546
Dark Vanilla Lockscreen mods for Droid X - Metamorph needed

View 17 Replies View Related

HTC EVO 4G :: Need Thread Rooting For Dummies + Extras Stickied?

Nov 19, 2010

I first want to start by saying I mean zero disrespect. I have the utmost respect for the moderators here and all the people who make this the most user friendly android forum around! With that said is there any way to have the thread ROOTING For Dummies + Extras stickied? This is nearly a request. Mat lock has made a great guide that has been proven to be a great tool. Im sure many people would agree that having it stickied would benefit many users especially the newer users trying to learn. Short and sweet, to the point.

View 4 Replies View Related

Sony Ericsson Xperia X10 : Need New Look Homescreen - With Extras

Oct 20, 2010

So many people may be reading this, wondering just what its all about, well, here goes.

As of probably August/September i was new in here, with no idea what to do with the X10 - through the X10 community - nay FAMILY - on this forum, i have developed from someone using basic stock icons, to well, a fully custom layout. HUGE HUGE thanks go out to X10iUser for the guidance in getting my phone here and the late night tutorial tonight lol

and to everyone else in this forum with their thoughts and ideas - whether its on what widget looks nice, or what background - keep them going, cos they bring us to the end results we dream of (well it has done mine lol)

So thats where i came to - i've modded the HTC Keyboard - which CuBz does an awesome job on explaining how to install here How to install HTC keyboard Step-by-step

and then modded with the guide from GIMPSTA at XDA here http://www.gimpsta.com/themer/main.php, the homescreens were taken from advice on widgets and apps in here Show Us Your X10 Homescreen... and the fonts from here Android Fonts... I have imaged a few different screens from my setup here http://androidforums.com/1774631-post41.html

So to close it off - if you feel stupid (trust me, i did), confused or just curious about something, ask the question - after asking the question you have some idea's then share them - after you've shared them and you want to progress further - then i'm sure someone can help

Look where i took mine to from its simple beginnings in a few weeks. And if i haven't laid credit where credit is due then please, let me know and i will reference and update it. Now sod it, its 4am - i'm off to bed

View 8 Replies View Related

Android :: Launch The Same Activity From Widget With Different Extras - Prevent Same Instance Show Up After Returned From HOME Button?

Nov 5, 2010

I have a widget that contains 4 buttons to show 4 stock prices, each of them will launch into the same activity Quote.class to show stock details. In onUpdate(), it will set up the pendingIntent with extras with stock symbol. After I hit button A, it goes to Quote activity that shows stock A. Then I hit the BACK button to the homescreen, Quote activity calls onDestroy() and when I hit button B, stock B will show properly. However, when i hit HOME button after it shows stock A, the Quote activity only calls onStop without calling onDestroy(), then as i hit button B, it will call onStart() and it shows the same instance that shows stock A.

CODE:............

Originally I thought adding a flag in the Intent should solve this problem. But I have tried
i.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK or FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_NO_HISTORY), none of them makes any difference.

So is there any ways to make it work? How can i remove the history stack from HOME button? How can I call onCreate in Quote activity and get new extras when i hit button B?

View 4 Replies View Related

Android :: Update Ongoing Notification Only When Notification Window Shown?

Jun 4, 2010

Is there any way to detect whether the Notification Windows is being shown? I have a service that updates an ongoing notification, complete with a progress bar and text? Is there a way to know if the notifiication screen is actually being shown, so I can adjust how often I wouldn't be so concerned if not for the fact that the HTC Incredible will reboot after it receives several hundred or so updates. Based on a controlled experiment with a beta tester, the service could continue for 24 hours if it did not update progress, but dies after several hundred updates. So I am desperate to reduce the notifications, if that's what works, and one of the ways I could do that is by not updating as much or at all if that screen isn't being shown.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved