Search in sources :

Example 1 with DonateFragment

use of com.abewy.android.apps.klyph.fragment.DonateFragment in project Klyph by jonathangerbaud.

the class DonateActivity method onActivityResult.

/**
	 * Needed for Google Play In-app Billing. It uses
	 * startIntentSenderForResult(). The result is not propagated to the
	 * Fragment like in startActivityForResult(). Thus we need to propagate
	 * manually to our Fragment.
	 * 
	 * @param requestCode
	 * @param resultCode
	 * @param data
	 */
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    FragmentManager fragmentManager = getFragmentManager();
    Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
    if (fragment != null) {
        ((DonateFragment) fragment).onActivityResult(requestCode, resultCode, data);
    }
}
Also used : FragmentManager(android.app.FragmentManager) DonateFragment(com.abewy.android.apps.klyph.fragment.DonateFragment) Fragment(android.app.Fragment) DonateFragment(com.abewy.android.apps.klyph.fragment.DonateFragment)

Example 2 with DonateFragment

use of com.abewy.android.apps.klyph.fragment.DonateFragment in project Klyph by jonathangerbaud.

the class DonateActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.donate_activity_title);
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    DonateFragment donationsFragment = DonateFragment.newInstance(false, GOOGLE_PUBKEY, GOOGLE_CATALOG, getResources().getStringArray(R.array.donate_google_catalog_values));
    ft.replace(R.id.fragment_container, donationsFragment, "donationsFragment");
    ft.commit();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) DonateFragment(com.abewy.android.apps.klyph.fragment.DonateFragment)

Aggregations

DonateFragment (com.abewy.android.apps.klyph.fragment.DonateFragment)2 Fragment (android.app.Fragment)1 FragmentManager (android.app.FragmentManager)1 FragmentTransaction (android.app.FragmentTransaction)1