in my android application i'm using a service to check every 10 seconds if there is a new message in the mysql database, and give me a notification, so when i click on the notification the messages activity start, but when i click on the back button i go out of the application instead of going back to HomeScreen
//show notification
public void ShowNotification(){
NotificationCompat.Builder nbuild= new NotificationCompat.Builder(this)
.setContentTitle("Message :"+username)
.setContentText(messagetext)
.setSubText(messageadddate)
.setLargeIcon(bitmap)
.setAutoCancel(true)
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setSmallIcon(R.drawable.ic_stat_notification_red);
Intent showMessages = new Intent(this, ShowMessages.class);
TaskStackBuilder builder = TaskStackBuilder.create(this);
builder.addParentStack(HomeScreen.class);
builder.addNextIntent(showMessages);
PendingIntent contentIntent = builder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
nbuild.setContentIntent(contentIntent);
MessagesNotifManager.notify((int) System.currentTimeMillis(), nbuild.build());
}