當前位置: 首頁>>代碼示例>>Java>>正文


Java BackupAgentHelper類代碼示例

本文整理匯總了Java中android.app.backup.BackupAgentHelper的典型用法代碼示例。如果您正苦於以下問題:Java BackupAgentHelper類的具體用法?Java BackupAgentHelper怎麽用?Java BackupAgentHelper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BackupAgentHelper類屬於android.app.backup包,在下文中一共展示了BackupAgentHelper類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import android.app.backup.BackupAgentHelper; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    String mode = null;
    if(getIntent().getExtras() != null)
        mode = getIntent().getExtras().getString("mode");

    if (Build.VERSION.SDK_INT < 16)
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES | GameHelper.CLIENT_SNAPSHOT);
    gameHelper.setup(this);
    helper = new BackupAgentHelper();
    //gameHelper.setConnectOnStart(true);

    final AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
    config.useAccelerometer = true;
    config.useWakelock = true;
    config.useImmersiveMode = false;
    config.useGyroscope = true;
    //initialize(new TDGalaxy(this, null, this), config);
    View view = initializeForView(new TDGalaxy(mode,this, null, this, this), config);
    RelativeLayout layout = new RelativeLayout(this);
    MobileAds.initialize(this, Constants.ADSENSE_ID);

    banner = new AdView(this);
    banner.setAdSize(AdSize.SMART_BANNER);
    banner.setAdUnitId(Constants.AD_BANNER);
    banner.setBackgroundColor(Color.BLACK);

    rewardVideo = MobileAds.getRewardedVideoAdInstance(this);
    rewardVideo.setRewardedVideoAdListener(this);
    rewardVideo.loadAd(Constants.AD_VIDEO, new AdRequest.Builder().build());

    RelativeLayout.LayoutParams adParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
    adParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
    adParams.addRule(RelativeLayout.CENTER_IN_PARENT);
    layout.addView(view);
    layout.addView(banner, adParams);
    setContentView(layout);
    banner.setVisibility(View.VISIBLE);
}
 
開發者ID:justinmarentette11,項目名稱:Tower-Defense-Galaxy,代碼行數:43,代碼來源:AndroidLauncher.java

示例2: BackupAgentHelperWrapper

import android.app.backup.BackupAgentHelper; //導入依賴的package包/類
public BackupAgentHelperWrapper() {
	if (isAvailable) {
		instance = new BackupAgentHelper();
		Log.d(TAG, "instance:" + instance);
	}
}
 
開發者ID:gjedeer,項目名稱:androidwisprclient,代碼行數:7,代碼來源:BackupAgentHelperWrapper.java


注:本文中的android.app.backup.BackupAgentHelper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。