Java Code Examples for android.support.v7.app.ActionBarActivity#RESULT_OK

The following examples show how to use android.support.v7.app.ActionBarActivity#RESULT_OK . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BooksAroundMeFragment.java    From barterli_android with Apache License 2.0 6 votes vote down vote up
@Override
public void onActivityResult(final int requestCode, final int resultCode,
                             final Intent data) {
    if (requestCode == RequestCodes.SCAN_ISBN
            && resultCode == ResultCodes.SUCCESS) {

        Bundle args = null;
        if (data != null) {
            args = data.getExtras();
        }

        loadAddOrEditBookFragment(args);

    } else if (requestCode == RequestCodes.ADD_BOOK && resultCode == ActionBarActivity
            .RESULT_OK) {

        final String bookId = data.getStringExtra(DatabaseColumns.ID);

        final Intent bookDetailIntent = new Intent(getActivity(), BookDetailActivity.class);
        bookDetailIntent.putExtra(Keys.ID, bookId);
        startActivity(bookDetailIntent);
    } else {
        super.onActivityResult(requestCode, resultCode, data);
    }
}
 
Example 2
Source File: LoginFragment.java    From barterli_android with Apache License 2.0 6 votes vote down vote up
@Override
public void onActivityResult(final int requestCode, final int resultCode,
                             final Intent data) {

    if (requestCode == AppConstants.RequestCodes.RESET_PASSWORD && resultCode ==
            ActionBarActivity.RESULT_OK) {

        getActivity().setResult(ActionBarActivity.RESULT_OK, data);
        getActivity().finish();
    } else {
        super.onActivityResult(requestCode, resultCode, data);
    }
    Session.getActiveSession()
           .onActivityResult(getActivity(), requestCode, resultCode, data);


}
 
Example 3
Source File: PreferencesFragment.java    From Android-PreferencesManager with Apache License 2.0 6 votes vote down vote up
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == CODE_EDIT_FILE && resultCode == ActionBarActivity.RESULT_OK) {
        loadingView.setVisibility(View.VISIBLE);
        gridView.setVisibility(View.GONE);

        if (getActivity() != null) {
            Animation fadeInAnim = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in);
            if (fadeInAnim != null) {
                loadingView.startAnimation(fadeInAnim);
            }
            Animation fadeOutAnim = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_out);
            if (fadeOutAnim != null) {
                gridView.startAnimation(fadeOutAnim);
            }
        }
        launchTask();
    }
    super.onActivityResult(requestCode, resultCode, data);
}
 
Example 4
Source File: BookDetailFragment.java    From barterli_android with Apache License 2.0 5 votes vote down vote up
@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {

    if (requestCode == AppConstants.RequestCodes.EDIT_BOOK && resultCode == ActionBarActivity
            .RESULT_OK) {
        updateBookDetails(data.getExtras());
    } else {
        super.onActivityResult(requestCode, resultCode, data);
    }
}
 
Example 5
Source File: NavDrawerFragment.java    From barterli_android with Apache License 2.0 5 votes vote down vote up
@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {

    if (requestCode == AppConstants.RequestCodes.LOGIN || requestCode == AppConstants
            .RequestCodes.ONWARD) {

        if (resultCode == ActionBarActivity.RESULT_OK) {

            boolean defaultFlow = true;
            if (data != null) {

                final Intent onwardIntent = data.getParcelableExtra(
                        AppConstants.Keys.ONWARD_INTENT);

                if (onwardIntent != null) {
                    defaultFlow = false;
                    startActivityForResult(onwardIntent, AppConstants.RequestCodes.ONWARD);
                }
            }

            if (defaultFlow) {
                launchCurrentUserProfile();
            }
        }
    } else {
        super.onActivityResult(requestCode, resultCode, data);
    }
}