tags:

views:

71

answers:

2

I'm trying to use the function [context].startSubActivity([intent i]) but that won't compile. Apparently startSubActivity() doesn't exist in Android 2.01? I do see a bunch of startActivity(...) functions, but no startSubActivity, which so many examples provide. Would someone please tell me if it's been deprecated, or maybe I'm just not including some library Eclipse isn't helping me find? :)

What I'm trying to do is launch a subactivity inside of a TimerTask inside my app.

Thanks!

-Auri

+1  A: 

As far as I know, startSubActivity is now [startActivityForResult][1] (It seems I can't link this correctly, so copy the full link manually). Here a link to confirm this.

[1]: http://developer.android.com/intl/zh-CN/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)

janfsd
Question - the view changes when I use startActivityForResult. Is there any way to suppress the view change? Thanks!!!
Auri Rahimzadeh
With view change do you mean the animation between activities? You could change the transition animation to have none at all, but I think you would still notice this 'change'. Here a question on how to do this: http://stackoverflow.com/questions/2286315/disable-activity-slide-in-animation-when-launching-new-activity You could change your logic to use a ViewFlipper instead if you have got many views, or if only two a ViewSwitcher or just change the visibility of your views.
janfsd
A: 

Use either startActivity or startActivityForResult (if you want to send something back from the child activity to the parent activity, remember to implement onActivityResult).

BrennaSoft
startActivity didn't work the same way. Bummer. :-P
Auri Rahimzadeh