Monday, May 30, 2011

[android-developers] Re: switching from one app to another

in manifest file put intent filter as callback and browseable


On May 29, 1:02 pm, Dianne Hackborn <hack...@android.com> wrote:
> This will also cause the browser to add new windows/tabs to the single task
> it maintains.  Please don't do this kind of thing. :}
>
>
>
> On Sun, May 29, 2011 at 12:01 AM, Doug <beafd...@gmail.com> wrote:
> > On May 26, 5:06 pm, bob <b...@coolgroups.com> wrote:
> > > I have an app that opens a web browser, but after awhile I want the
> > > app to switch from the web browser back to itself.  Is there an easy
> > > way to do this?
>
> > I agree with Justin and Mark, but I don't have any ethical qualms in
> > sharing a solution that does what you want anyway!  :-)
>
> > Below, if the started Dummy class just called finish() when launched,
> > this will achieve the effect you are looking for, but the browser task
> > will still be alive and the user could return to it if they want.
>
> > By the way, don't do this unless you really understand what you're
> > getting into.
>
> > Doug
>
> > public class Main extends Activity {
> >    Handler handler;
>
> >    @Override
> >    public void onCreate(final Bundle savedInstanceState) {
> >        super.onCreate(savedInstanceState);
> >        setContentView(R.layout.main);
> >        handler = new Handler();
> >        findViewById(R.id.button).setOnClickListener(new
> > View.OnClickListener() {
> >            public void onClick(final View v) {
> >                startActivity(new Intent(Intent.ACTION_VIEW,
> > Uri.parse("http://www.google.com")));
> >                handler.postDelayed(new Runnable() {
> >                    public void run() {
> >                        final Intent intent = new Intent(Main.this,
> > Dummy.class);
>
> > intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> >                        getApplicationContext().startActivity(intent);
> >                    }
> >                }, 10000);
> >            }
> >        });
> >     }
> > }
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment