1. Download our Official Android App: Forums for Android!

Apps BroadcastReceiver ...... Help

Discussion in 'Android Development' started by Osama Ahmad, May 13, 2011.

  1. Osama Ahmad

    Osama Ahmad Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    9
    Joined:
    Feb 23, 2011

    Feb 23, 2011
    9
    0
    25
    Hi, can anybody help me in this problem :)

    public class IncomingCallReceiver extends BroadcastReceiver
    {
    @Override
    public void onReceive(Context context, Intent intent)
    {
    i want to show dialog with "ok" or "cancel"
    if press on ok then show Intent "A"
    }
    }


    Help pls.
     

    Advertisement

  2. miXer

    miXer Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    313
    Joined:
    Aug 12, 2010

    Aug 12, 2010
    313
    51
    53
    Norway
    The BroadcastReceiver ends as soon as it leaves the onReceive() method, so to show a dialog you need to start an activity via context.startActivity()
     
    Osama Ahmad likes this.
  3. Osama Ahmad

    Osama Ahmad Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    9
    Joined:
    Feb 23, 2011

    Feb 23, 2011
    9
    0
    25

Share This Page

Loading...