Its possible that you don't have the right context. If possible, try
storing the appropriate context in your own activity similar to a
singleton, and then calling startActivity on that context.

On Apr 13, 11:55 pm, mariush <[email protected]> wrote:
> Hi,
> Lets suppose that i have an activity A, that activity is moved to
> background(function  moveTaskToBack is used), and after while i want
> to bring this activity to front again. This code is used:
> Activity A = getActivity();
> Intent i = new Intent(A, A.getClass());
>  i.setAction(Intent.ACTION_MAIN);
>  i.addCategory(Intent.CATEGORY_LAUNCHER);
>  i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>  A.startActivity(i);
>
> Activity is on screen, but when i invoke later moveTaskToBack on A
> activity, activity is not moved to backgorund.
> Does anyone know why?
> Regards
> Mariush

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

Reply via email to