1

I want to show a pop-up message after completing my current task, which is running in the background. The pop-up message must be poped up on current activity.

How i can achieve this?

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
OnkarDhane
  • 1,450
  • 2
  • 14
  • 24
  • The title should reflect what the problem is about. "Hi,Android developers" doesn't do that. Please remember that for the future. Thanks. – Joachim Sauer Feb 28 '11 at 07:17
  • Before I help you I need some more details from you. What do you use in background. Is it asynctask or service? – Prasham Feb 28 '11 at 07:32
  • 1
    Use Async Task......Simple question and simple answer.... – N-JOY Feb 28 '11 at 07:52
  • @joa yes i will remember that,as i am new on this forum and in development also...dats y... – OnkarDhane Mar 02 '11 at 04:24
  • @prasham yes in background progress bar is running which have some time limit(Ex. 2min) then after completing 2min i want to show pop-up message. i have done with progress bar now pop-up message is remain....so,please tell me how to achieve??? – OnkarDhane Mar 02 '11 at 04:26

5 Answers5

1

AlertDialog is probably what you are looking for

Reno
  • 33,594
  • 11
  • 89
  • 102
1

You can also use Toast.

iamtheexp01
  • 3,446
  • 9
  • 35
  • 35
  • toast is disapear automatically but i must see that message box until i perform some function on that message box only..so,please help me how i can achieve this??? – OnkarDhane Feb 28 '11 at 07:35
1

You can use either Toast or AlertDialog.

Toast is less intrusive, and cannot take any input, usually best to alert the user of a timer going off or something similar, they disappear by themselves.

AlertDialog is a bit more intrusive since they (usually) don't go away by them selfs, but they can take input, but from my experience they are best for picking an option like "are you sure you want to exit?" or displaying a loading bar since you can put images and other widgets in them.

But another way would be a Notification.

Although this doesn't "pop-out" it is another possibility and depending on your app could be a better choice.

Gunslinger
  • 1,456
  • 7
  • 22
  • 36
  • as you said think its better to use notification if running a service or alert dialog if its an activity. – GoodSp33d Feb 28 '11 at 07:54
0

Hi
You can use handle

The way is :
in your background class

protected Handler m_Handle = null;


than you finish your task add
m_Handle.sendEmptyMessage(for ex: PopupType );


in your activity

public Handler myHandle = new Handler()
{
    @Override
    public void handleMessage(Message msg)
    {
      show dialog
    }
}
Mikhaili
  • 161
  • 6
0

i think you can do the talk in background using the services then show popup up activity same way that i have did android:chat app popup view

Thank you.

Community
  • 1
  • 1
Sameer Z.
  • 3,265
  • 9
  • 48
  • 72