android


how to open a specific window on notification click in titanium android


i am developing a mobile app for android OS using titanium sdk version 3.1.1.GA and i am struggling to get it worked.
what i want to do is open a specific window when i click on the notification.
i am able to show a notification but when i click on it it shows the last window from the activity stack.
my code to create notification from service.js
var intent = Ti.Android.createIntent({
action : Ti.Android.ACTION_MAIN,
// className : '<application id>.NotifierActivity',
url : 'alertmsg.js',
flags : Ti.Android.FLAG_ACTIVITY_NEW_TASK | Ti.Android.FLAG_ACTIVITY_CLEAR_TOP
});
intent.addCategory(Titanium.Android.CATEGORY_LAUNCHER);
// Create a PendingIntent to tie together the Activity and Intent
var pending = Titanium.Android.createPendingIntent({
intent: intent,
flags: Titanium.Android.FLAG_UPDATE_CURRENT
});
// Create the notification
var notification = Titanium.Android.createNotification({
// icon is passed as an Android resource ID -- see Ti.App.Android.R.
//icon: Ti.App.Android.R.drawable.my_icon,
contentTitle: 'Reminder pending',
contentText : 'Click to return to the application.',
contentIntent: pending,
//sound: 'click.mp3',
defaults: Titanium.Android.NotificationManager.DEFAULT_ALL,
});
// Send the notification.
Titanium.Android.NotificationManager.notify(1, notification);
code from my TiApp.xml file
<android xmlns:android="http://schemas.android.com/apk/res/android">
<services>
<service type="interval" url="logservice.js"/>
</services>
<manifest>
<uses-permission android:name="android.permission.VIBRATE" ></uses-permission>
</manifest>
<application>
<activities>
<activity url="alertmsg.js">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
</activities>
</application>
</android>
any help??
Thanks in advance.

Related Links

SQLite Database vs. File based Data storage from Battery Performance Impact perspective
Can I refere to any other xml to style my dynamic layouts
Android Image Banner with sliding feature
FLAG_ACTIVITY_NO_HISTORY with intent pointing to external activity doesn't work. Is that possible?
Android WindowManager changing screen orientation
Enabling/Disabling all buttons in a Grid Layout
How to combine Google map and Place API in Android
android.os.NetworkOnMainThreadException when calling REST api [duplicate]
How to display local video thumbnails with glide WITHOUT slowing down the listview?
Android ViewPager Loading fragments in wrong sequence
Recommendation for cross platform mobile software [closed]
Android | Convert char String to byte array
selectable textview in recycleview, auto scoll to top when viewpager switchback
Android modify your app to make sure it doesn't enable background play of YouTube videos
Android app crashes while starting new activity
How to set big custom mediaplayer notification in android api 16 or higher?

Categories

HOME
google-app-engine
fabricjs
microsoftgraph
prism
amp-html
3d
apache-spark-mllib
requirements
can
access
entity-framework-core
alsa
echo
azure-container-service
nstableheaderview
teechart
p2p
ibeacon-android
text-mining
datastage
jsonpath
zerobrane
scrolltop
android-intent
glyphicons
dreamweaver
git-extensions
smartclient
jmp
bourbon
asciidoctor-pdf
dataflow-diagram
highstock
beautifier
nstimer
progress-bar
apktool
subclass
failover
vex
winpe
sqsh
google-earth
eviews
mustache
playstation-portable
autolisp
installshield-le
reason
imagenet
metaprogramming
demo
news
watchface
odoo-website
postgresql-8.4
contract
angular-http
apache-directory
uiimage
dapper-simplecrud
dbcontext
podscms
css-transforms
filenet
testrail
omxplayer
qtplugin
scaffolding
grass
vhosts
grgit
jdi
android-launcher
cgi-bin
visual-sourcesafe-2005
rpart
uncompress
dronekit-android
airbrake
snackbar
diff3
mmwormhole
android-vibration
ghcjs
spy++
entry-point
imagefilter
rmysql
raygun
kissfft
personalization
tinyxml
spring-3
light
mongohq
resource-management
fragmenttransaction
box2d-iphone
denied
automationelement
xui
load-time
non-clustered-index
isapi-extension
pos-for-.net
product-management

Resources

Encrypt Message