I am creating View component, which is able to open dialog for user input. I am able startActivityForResult inside Activity, but for some reasons I can’t make component direct in activity class. Code is ease:
Context context = getContext();
if (context instanceof Activity)
((Activity)context).startActivityForResult(...);
else
context.startActivity(..) //fallback
How I can determine when activity is closed and catch result if possible?
Make flag which in onCreate make false, and saved him to singltone or SharedPreferences, and in onDestroy this flag make true and save him. For catch result make receiver in current Activity on which send result from onDestroy. Or result work in onDestroy you can save to singltone or SharedPreference.
Thanks at time.