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


Java PersistableBundle类代码示例

本文整理汇总了Java中android.os.PersistableBundle的典型用法代码示例。如果您正苦于以下问题:Java PersistableBundle类的具体用法?Java PersistableBundle怎么用?Java PersistableBundle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: requestSync

import android.os.PersistableBundle; //导入依赖的package包/类
public static void requestSync(Context context, String inputId, boolean currentProgramOnly) {
    PersistableBundle pBundle = new PersistableBundle();
    pBundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
    pBundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
    pBundle.putString(SyncJobService.BUNDLE_KEY_INPUT_ID, inputId);
    pBundle.putBoolean(SyncJobService.BUNDLE_KEY_CURRENT_PROGRAM_ONLY, currentProgramOnly);
    JobInfo.Builder builder = new JobInfo.Builder(REQUEST_SYNC_JOB_ID,
            new ComponentName(context, SyncJobService.class));
    JobInfo jobInfo = builder
            .setExtras(pBundle)
            .setOverrideDeadline(SyncJobService.OVERRIDE_DEADLINE_MILLIS)
            .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
            .build();
    scheduleJob(context, jobInfo);
    Intent intent = new Intent(SyncJobService.ACTION_SYNC_STATUS_CHANGED);
    intent.putExtra(SyncJobService.BUNDLE_KEY_INPUT_ID, inputId);
    intent.putExtra(SyncJobService.SYNC_STATUS, SyncJobService.SYNC_STARTED);
    LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:20,代码来源:SyncUtils.java

示例2: scheduleAddWatchNextRequest

import android.os.PersistableBundle; //导入依赖的package包/类
public static void scheduleAddWatchNextRequest(Context context, ClipData clipData) {
    JobScheduler scheduler = (JobScheduler) context.getSystemService(JOB_SCHEDULER_SERVICE);

    PersistableBundle bundle = new PersistableBundle();
    bundle.putString(ID_KEY, clipData.getClipId());
    bundle.putString(CONTENT_ID_KEY, clipData.getContentId());
    bundle.putLong(DURATION_KEY, clipData.getDuration());
    bundle.putLong(PROGRESS_KEY, clipData.getProgress());
    bundle.putString(TITLE_KEY, clipData.getTitle());
    bundle.putString(DESCRIPTION_KEY, clipData.getDescription());
    bundle.putString(CARD_IMAGE_URL_KEY, clipData.getCardImageUrl());

    scheduler.schedule(new JobInfo.Builder(1,
            new ComponentName(context, AddWatchNextService.class))
            .setMinimumLatency(0)
            .setExtras(bundle)
            .build());
}
 
开发者ID:googlesamples,项目名称:leanback-homescreen-channels,代码行数:19,代码来源:AddWatchNextService.java

示例3: onCreate

import android.os.PersistableBundle; //导入依赖的package包/类
@Override
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
	super.onCreate(savedInstanceState, persistentState);
	setContentView(R.layout.fragment_about);

	webView = findViewById(R.id.web_view);
	webView.setNetworkAvailable(false);
	webView.setWebViewClient(new WebViewClient(){
		@Override
		public boolean shouldOverrideUrlLoading(WebView view, String url){
			if(url.startsWith("http")){
				depth++;
				return false;
			} else {
				url = url.replace("file:///android_asset/","");
				loadAsset(url);
				return true;
			}
		}
	});
	loadAsset("file:///android_asset/about.html");
}
 
开发者ID:NiciDieNase,项目名称:chaosflix,代码行数:23,代码来源:AboutActivity.java

示例4: onCreate

import android.os.PersistableBundle; //导入依赖的package包/类
@ReplaceMethod
public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
  if (!com_rakuten_tech_mobile_perf_onCreate_tracking) {
    com_rakuten_tech_mobile_perf_onCreate_tracking = true;

    int id = Tracker.startMethod(this, "onCreate");

    try {
      onCreate(savedInstanceState, persistentState);
    } finally {
      Tracker.endMethod(id);
      com_rakuten_tech_mobile_perf_onCreate_tracking = false;
    }
  } else {
    onCreate(savedInstanceState, persistentState);
  }
}
 
开发者ID:rakutentech,项目名称:android-perftracking,代码行数:18,代码来源:ActivityMixin.java

示例5: onSaveInstanceState

import android.os.PersistableBundle; //导入依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
    /*
    To maintain activity state across reboots the system saves and restore critical information for
    all tasks and their activities. Information known by the system includes the activity stack order,
    each task’s thumbnails and each activity’s and task's Intents. For Information that cannot be retained
    because they contain Bundles which can’t be persisted a new constrained version of Bundle,
    PersistableBundle is added. PersistableBundle can store only basic data types. To use it
    in your Activities you must declare the new activity:persistableMode attribute in the manifest.
     */
    outPersistentState.putInt(KEY_EXTRA_NEW_DOCUMENT_COUNTER, mDocumentCounter);
    super.onSaveInstanceState(outState, outPersistentState);
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:14,代码来源:DocumentCentricActivity.java

示例6: createProcessJobInfoBuilder

import android.os.PersistableBundle; //导入依赖的package包/类
public static JobInfo.Builder createProcessJobInfoBuilder(Context context, int jobId, QueuedSiteToSiteClientConfig queuedSiteToSiteClientConfig, ParcelableQueuedOperationResultCallback parcelableQueuedOperationResultCallback) {
    JobInfo.Builder builder = new JobInfo.Builder(jobId, new ComponentName(context, SiteToSiteJobService.class));
    PersistableBundle persistableBundle = new PersistableBundle();
    SerializationUtils.putParcelable(queuedSiteToSiteClientConfig, persistableBundle, "config");
    SerializationUtils.putParcelable(parcelableQueuedOperationResultCallback, persistableBundle, "callback");
    builder.setExtras(persistableBundle);
    return builder;
}
 
开发者ID:hortonworks,项目名称:nifi-android-s2s,代码行数:9,代码来源:SiteToSiteJobService.java

示例7: onSaveInstanceState

import android.os.PersistableBundle; //导入依赖的package包/类
/***************************************************/
@Override
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
    super.onSaveInstanceState(outState, outPersistentState);
    outState.putString(EXTRA_BILL_ID,mBillId);
    outState.putString(EXTRA_BILL_NAME,mBillName);
}
 
开发者ID:newbiechen1024,项目名称:NovelReader,代码行数:8,代码来源:OtherBillBookActivity.java

示例8: putParcelable

import android.os.PersistableBundle; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public static <T extends Parcelable> void putParcelable(T parcelable, PersistableBundle persistableBundle, String name) {
    if (parcelable == null) {
        return;
    }
    PersistableBundle bundle = new PersistableBundle();
    bundle.putString("class", parcelable.getClass().getCanonicalName());
    bundle.putString("data", Base64.encodeToString(marshallParcelable(parcelable), 0));
    persistableBundle.putPersistableBundle(name, bundle);
}
 
开发者ID:hortonworks,项目名称:nifi-android-s2s,代码行数:11,代码来源:SerializationUtils.java

示例9: onPostCreate

import android.os.PersistableBundle; //导入依赖的package包/类
@Override
public void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
    super.onPostCreate(savedInstanceState, persistentState);
    // Restore state from PersistableBundle
    if (persistentState != null) {
        mDocumentCounter = persistentState.getInt(KEY_EXTRA_NEW_DOCUMENT_COUNTER);
    }
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:9,代码来源:DocumentCentricActivity.java

示例10: onCreate

import android.os.PersistableBundle; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
    super.onCreate(savedInstanceState, persistentState);/*
    setContentView(R.layout.measurement_activity);

    findViews();
    setListener();*/
}
 
开发者ID:Welloculus,项目名称:MobileAppForPatient,代码行数:9,代码来源:PCLinkLibraryCommuTestActivity.java

示例11: doInBackground

import android.os.PersistableBundle; //导入依赖的package包/类
@Override
protected Void doInBackground(Void... params) {
    PersistableBundle bundle = mJobParameters.getExtras();
    if (bundle == null) {
        Log.e(TAG, "No data passed to task for job " + mJobParameters.getJobId());
        return null;
    }

    String id = bundle.getString(ID_KEY);
    String contentId = bundle.getString(CONTENT_ID_KEY);
    long duration = bundle.getLong(DURATION_KEY);
    long progress = bundle.getLong(PROGRESS_KEY);
    String title = bundle.getString(TITLE_KEY);
    String description = bundle.getString(DESCRIPTION_KEY);
    String cardImageURL = bundle.getString(CARD_IMAGE_URL_KEY);

    ClipData clipData = new ClipData.Builder().setClipId(id)
            .setContentId(contentId)
            .setDuration(duration)
            .setProgress(progress)
            .setTitle(title)
            .setDescription(description)
            .setCardImageUrl(cardImageURL)
            .build();

    SampleTvProvider.addWatchNextContinue(getApplicationContext(), clipData);
    return null;

}
 
开发者ID:googlesamples,项目名称:leanback-homescreen-channels,代码行数:30,代码来源:AddWatchNextService.java

示例12: setUpPeriodicSync

import android.os.PersistableBundle; //导入依赖的package包/类
public static void setUpPeriodicSync(Context context, String inputId) {
    PersistableBundle pBundle = new PersistableBundle();
    pBundle.putString(SyncJobService.BUNDLE_KEY_INPUT_ID, inputId);
    JobInfo.Builder builder = new JobInfo.Builder(PERIODIC_SYNC_JOB_ID,
            new ComponentName(context, SyncJobService.class));
    JobInfo jobInfo = builder
            .setExtras(pBundle)
            .setPeriodic(SyncJobService.FULL_SYNC_FREQUENCY_MILLIS)
            .setPersisted(true)
            .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
            .build();
    scheduleJob(context, jobInfo);
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:14,代码来源:SyncUtils.java

示例13: onSaveInstanceState

import android.os.PersistableBundle; //导入依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
    super.onSaveInstanceState(outState, outPersistentState);
    outState.putString("firstname", firstname.getText().toString());
    outState.putString("lastname", lastname.getText().toString());
    outState.putString("email", username.getText().toString());
    setViews(false);
}
 
开发者ID:akshayub,项目名称:NITKart,代码行数:9,代码来源:newUser.java

示例14: callActivityOnCreate

import android.os.PersistableBundle; //导入依赖的package包/类
@Override
public void callActivityOnCreate(Activity activity, Bundle icicle, PersistableBundle persistentState) {
    if (icicle != null) {
        BundleCompat.clearParcelledData(icicle);
    }
    super.callActivityOnCreate(activity, icicle, persistentState);
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:8,代码来源:AppInstrumentation.java

示例15: onCreate

import android.os.PersistableBundle; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
    setContentView(R.layout.activity_wellcomeinour);

    ViewUtils.inject(this);
    httpUtils=new HttpUtils();
    mobile=telephoneNum.getText().toString();

}
 
开发者ID:liupengandroid,项目名称:ywApplication,代码行数:10,代码来源:WellcomeAddOurActivity.java


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