I am developing an app. And min SDK is 14. And now i am going to open new Activity from Fragment, when user clicks button on the fragment.
//code that open new activity
newFavoriteFAB.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent mIntent = new Intent(getActivity(), CategoriesActivity.class);
Bundle mBundle = new Bundle();
mBundle.putInt(BundleConstants.OPERATION_TYPE, OperationTypes.ADD_FAVORITE);
mIntent.putExtras(mBundle);
startActivityForResult(mIntent, ActivityStartRequestCode.ADD_FAVORITE);
}
});
//activity onCreate method, which trying to open
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
Log.d(TAG, "onCreate");
//here, when i am going to get it, i see that bundle argument is null
I tried to make it over the activity, but it says me that: Call requires API level 16. Because i use API 14 as minumum.
getActivity().startActivityForResult(mIntent, ActivityStartRequestCode.ADD_FAVORITE, mBundle);
Please provide working solution. Thanks