Reputation: 181
I am using robotium 3.6 and I want to get the current visible fragment of android.support.v4.app.FragmentActivity
. How to do this?
Upvotes: 1
Views: 909
Reputation: 5819
Assuming you are actually using the FragmentActivity, then solo.getCurrentActivity() should return the activity you want but it will be casted to an activity, you will need to cast it to an android.support.v4.app.FragmentActivity in the normal java way:
android.support.v4.app.FragmentActivity fragmentActivity = (android.support.v4.app.FragmentActivity) solo.getCurrentActivity();
This may not work if you have this inside a tabhost or such though.
Upvotes: 1