当前位置: 首页>>代码示例>>Java>>正文


Java SoomlaApp.getAppContext方法代码示例

本文整理汇总了Java中com.soomla.SoomlaApp.getAppContext方法的典型用法代码示例。如果您正苦于以下问题:Java SoomlaApp.getAppContext方法的具体用法?Java SoomlaApp.getAppContext怎么用?Java SoomlaApp.getAppContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.soomla.SoomlaApp的用法示例。

在下文中一共展示了SoomlaApp.getAppContext方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onStart

import com.soomla.SoomlaApp; //导入方法依赖的package包/类
@Override
protected void onStart() {
    SoomlaUtils.LogDebug(TAG, "onStart 1");
    super.onStart();

    if (!firstTime && SoomlaApp.getAppContext() instanceof Activity) {
        SoomlaUtils.LogDebug(TAG, "onStart 2");
        onActivityResult(10001, Activity.RESULT_CANCELED, null);

        Intent tabIntent = new Intent(this, ((Activity) SoomlaApp.getAppContext()).getClass());
        tabIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        SoomlaUtils.LogDebug(TAG, "onStart 3");
        startActivity(tabIntent);
    }
    SoomlaUtils.LogDebug(TAG, "onStart 4");
}
 
开发者ID:App47,项目名称:soomla-android-store-tapclash,代码行数:17,代码来源:TapClashIabService.java


示例2: launchPurchaseFlow

import com.soomla.SoomlaApp; //导入方法依赖的package包/类
/**
 * see parent
 */
@Override
public void launchPurchaseFlow(String sku,
                               final IabCallbacks.OnPurchaseListener purchaseListener,
                               String extraData) {

    SharedPreferences prefs = SoomlaApp.getAppContext().
            getSharedPreferences(SoomlaConfig.PREFS_NAME, Context.MODE_PRIVATE);
    String publicKey = prefs.getString(PUBLICKEY_KEY, "");
    if (publicKey.length() == 0 || publicKey.equals("[YOUR PUBLIC KEY FROM THE MARKET]")) {
        SoomlaUtils.LogError(TAG, "You didn't provide a public key! You can't make purchases. the key: " + publicKey);
        throw new IllegalStateException();
    }


    try {
        final Intent intent = new Intent(SoomlaApp.getAppContext(), IabActivity.class);
        intent.putExtra(SKU, sku);
        intent.putExtra(EXTRA_DATA, extraData);

        mSavedOnPurchaseListener = purchaseListener;
        if (SoomlaApp.getAppContext() instanceof Activity) {
            Activity activity = (Activity) SoomlaApp.getAppContext();
            activity.startActivity(intent);
        } else {
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            SoomlaApp.getAppContext().startActivity(intent);
        }

    } catch(Exception e){
        String msg = "(launchPurchaseFlow) Error purchasing item " + e.getMessage();
        SoomlaUtils.LogError(TAG, msg);
        purchaseListener.fail(msg);
    }

}
 
开发者ID:App47,项目名称:soomla-android-store-tapclash,代码行数:39,代码来源:TapClashIabService.java


示例3: dispose

import com.soomla.SoomlaApp; //导入方法依赖的package包/类
/**
 * Dispose of object, releasing resources. It's very important to call this
 * method when you are done with this object. It will release any resources
 * used by it such as service connections. Naturally, once the object is
 * disposed of, it can't be used again.
 */
public void dispose() {
    SoomlaUtils.LogDebug(TAG, "Disposing.");
    super.dispose();
    if (mServiceConn != null) {
        SoomlaUtils.LogDebug(TAG, "Unbinding from service.");
        if (SoomlaApp.getAppContext() != null && mService != null) SoomlaApp.getAppContext().unbindService(mServiceConn);
        mServiceConn = null;
        mService = null;
    }
}
 
开发者ID:App47,项目名称:soomla-android-store-tapclash,代码行数:17,代码来源:TapClashIabHelper.java


示例4: KeyValueStorage

import com.soomla.SoomlaApp; //导入方法依赖的package包/类
public KeyValueStorage(String storageName, String secret) {
    KeevaConfig.logDebug = SoomlaConfig.logDebug;
    try {
        Field obfuscationSaltField = KeevaConfig.class.getDeclaredField("obfuscationSalt");
        obfuscationSaltField.setAccessible(true);
        obfuscationSaltField.set(null, SoomlaConfig.obfuscationSalt);
        Field dbDeleteField = KeevaConfig.class.getDeclaredField("DB_DELETE");
        dbDeleteField.setAccessible(true);
        dbDeleteField.set(null, SoomlaConfig.DB_DELETE);
    } catch (Exception e) {
        SoomlaUtils.LogError(TAG, "Error setting SOOMLA's config to Keeva " + e.getLocalizedMessage());
    }
    mKeeva = new Keeva(SoomlaApp.getAppContext(), storageName, secret);
}
 
开发者ID:soomla,项目名称:soomla-android-core,代码行数:15,代码来源:KeyValueStorage.java


示例5: getTempImageDir

import com.soomla.SoomlaApp; //导入方法依赖的package包/类
private String getTempImageDir(){
    if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())){
        SoomlaUtils.LogDebug(TAG, "(getTempImageDir) External storage not ready.");
        return null;
    }

    ContextWrapper soomContextWrapper = new ContextWrapper(SoomlaApp.getAppContext());

    return Environment.getExternalStorageDirectory() + soomContextWrapper.getFilesDir().getPath() + "/temp/";
}
 
开发者ID:soomla,项目名称:android-profile,代码行数:11,代码来源:SoomlaProfile.java


示例6: launchPurchaseFlow

import com.soomla.SoomlaApp; //导入方法依赖的package包/类
/**
 * see parent
 */
@Override
public void launchPurchaseFlow(String itemType,
                               String sku,
                               final IabCallbacks.OnPurchaseListener purchaseListener,
                               String extraData) {

    SharedPreferences prefs = SoomlaApp.getAppContext().
            getSharedPreferences(SoomlaConfig.PREFS_NAME, Context.MODE_PRIVATE);
    String publicKey = prefs.getString(PUBLICKEY_KEY, "");
    if (publicKey.length() == 0 || publicKey.equals("[YOUR PUBLIC KEY FROM THE MARKET]")) {
        SoomlaUtils.LogError(TAG, "You didn't provide a public key! You can't make purchases. the key: " + publicKey);
        throw new IllegalStateException();
    }


    try {
        final Intent intent = new Intent(SoomlaApp.getAppContext(), IabActivity.class);
        intent.putExtra(SKU, sku);
        intent.putExtra(ITEM_TYPE, itemType);
        intent.putExtra(EXTRA_DATA, extraData);

        mSavedOnPurchaseListener = purchaseListener;
        if (SoomlaApp.getAppContext() instanceof Activity) {
            Activity activity = (Activity) SoomlaApp.getAppContext();
            activity.startActivity(intent);
        } else {
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            SoomlaApp.getAppContext().startActivity(intent);
        }

    } catch(Exception e){
        String msg = "(launchPurchaseFlow) Error purchasing item " + e.getMessage();
        SoomlaUtils.LogError(TAG, msg);
        purchaseListener.fail(msg);
    }

}
 
开发者ID:soomla,项目名称:android-store-google-play,代码行数:41,代码来源:GooglePlayIabService.java


示例7: launchPurchaseFlow

import com.soomla.SoomlaApp; //导入方法依赖的package包/类
/**
 * see parent
 */
@Override
public void launchPurchaseFlow(String sku,
                               final IabCallbacks.OnPurchaseListener purchaseListener,
                               String extraData) {

    SharedPreferences prefs = SoomlaApp.getAppContext().
            getSharedPreferences(SoomlaConfig.PREFS_NAME, Context.MODE_PRIVATE);
    String publicKey = prefs.getString(PUBLICKEY_KEY, "");

    try {
        final Intent intent = new Intent(SoomlaApp.getAppContext(), IabActivity.class);
        intent.putExtra(SKU, sku);
        intent.putExtra(EXTRA_DATA, extraData);

        mSavedOnPurchaseListener = purchaseListener;
        if (SoomlaApp.getAppContext() instanceof Activity) {
            Activity activity = (Activity) SoomlaApp.getAppContext();
            activity.startActivity(intent);
        } else {
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            SoomlaApp.getAppContext().startActivity(intent);
        }

    } catch(Exception e){
        String msg = "(launchPurchaseFlow) Error purchasing item " + e.getMessage();
        SoomlaUtils.LogError(TAG, msg);
        purchaseListener.fail(msg);
    }

}
 
开发者ID:Marneus68,项目名称:android-store-nokia-store,代码行数:34,代码来源:NokiaStoreIabService.java



注:本文中的com.soomla.SoomlaApp.getAppContext方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。