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


Java Intent.setClass方法代码示例

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


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

示例1: getMissingSubtitles

import android.content.Intent; //导入方法依赖的package包/类
protected void getMissingSubtitles(boolean force,ArrayList<String> allVideoPaths, ArrayList<String> missingSubVideoPaths){
    ArrayList<String> videoPaths;
    if(!force)
        videoPaths = missingSubVideoPaths;
    else
        videoPaths = allVideoPaths;
    if (videoPaths.isEmpty()&&!force){
        mDialogForceDlSubtitles = new DialogForceDlSubtitles();

        Bundle args = new Bundle();
        args.putSerializable(SubtitlesDownloaderActivity.FILE_URLS, allVideoPaths);
        mDialogForceDlSubtitles.setArguments(args);
        mDialogForceDlSubtitles.show(getFragmentManager(), null);
    }else {
        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.setClass(mContext, SubtitlesDownloaderActivity.class);
        intent.putExtra(SubtitlesDownloaderActivity.FILE_URLS, videoPaths);
        startActivity(intent);
    }
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:21,代码来源:Browser.java

示例2: startNBADetailActivity

import android.content.Intent; //导入方法依赖的package包/类
private void startNBADetailActivity(String id, String imgUrl, View view) {
    Intent intent = new Intent();
    intent.setClass(getActivity(), NBAActivity.class);
    intent.putExtra("id", id);
    intent.putExtra("url", imgUrl);
    /**
     * 用这个ActivityOptionsCompat比用ActivityOptions兼容性更好,前者是V4下的兼容到16后者到21.
     * ActivityOptionsCompat.makeSceneTransitionAnimation()的第三个参数则是跳转后图片显示的transitionName的值
     *     <android.support.design.widget.AppBarLayout
     android:transitionName="zhihu_detail_title"
     android:fitsSystemWindows="true">
     */
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(),
            view, getActivity().getResources().getString(R.string.zhihu_detail_title));
    getActivity().startActivity(intent, options.toBundle());
}
 
开发者ID:paterWang,项目名称:EasyReader,代码行数:17,代码来源:NBAFragment.java

示例3: gotoLockViewActivity

import android.content.Intent; //导入方法依赖的package包/类
/**
 * Go to lock activity.
 */
private void gotoLockViewActivity()
{
	Intent intent = new Intent();
	intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
	intent.setClass(this, LockViewActivity.class);
	intent.setAction(LockViewActivity.ACTION_LOCK_DECODE);
	startActivity(intent);
	
	finish();
}
 
开发者ID:benniaobuguai,项目名称:android-project-gallery,代码行数:14,代码来源:SplashActivity.java

示例4: gotoGirlDetail

import android.content.Intent; //导入方法依赖的package包/类
public void gotoGirlDetail(String url,String id) {
    Intent intent = new Intent();
    intent.setClass(mContext, GirlDetailActivity.class);
    intent.putExtra("url",url);
    intent.putExtra("id",id);
    mContext.startActivity(intent);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:LikeAdapter.java

示例5: comeOnBaby

import android.content.Intent; //导入方法依赖的package包/类
public static void comeOnBaby(Context context) {
    if (context != null) {
        Intent intent = new Intent();
        intent.setClass(context, SportCourseChangeActivity.class);
        context.startActivity(intent);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:SportCourseChangeActivity.java

示例6: getIntent

import android.content.Intent; //导入方法依赖的package包/类
/**
 * Get {@link CropImageActivity} intent to start the activity.
 */
public Intent getIntent(@NonNull Context context, @Nullable Class<?> cls) {
    mOptions.validate();

    Intent intent = new Intent();
    intent.setClass(context, cls);
    intent.putExtra(CROP_IMAGE_EXTRA_SOURCE, mSource);
    intent.putExtra(CROP_IMAGE_EXTRA_OPTIONS, mOptions);
    return intent;
}
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:13,代码来源:CropImage.java

示例7: notifyDownloadStart

import android.content.Intent; //导入方法依赖的package包/类
/**
 * 开始下载
 * 
 * @param context
 * @param title
 * @param icon
 */
private void notifyDownloadStart(Context context, Request request)
{
	RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.api_download_notification);
	remoteViews.setProgressBar(R.id.noti_progressBar, PROGRESSBAR_MAX, 0, false);
	remoteViews.setImageViewResource(R.id.noti_icon, R.drawable.notification_remote_icon);
	remoteViews.setTextViewText(R.id.noti_file_name, request.mTitle);
	
	String host = CommonUtils.getHost(request.mDownloadUrl);
	if (CommonUtils.isWo2bHost(request.mDownloadUrl))
	{
		remoteViews.setTextViewText(R.id.noti_progressBarLeft, "www.wo2b.com");
	}
	else
	{
		remoteViews.setTextViewText(R.id.noti_progressBarLeft, host);
	}
	
	
	// 执行取消操作的PendingIntent, 向DownloadService发起取消下载的命令
	Intent cancelIntent = new Intent();
	cancelIntent.setClass(context, DownloadService.class);
	cancelIntent.putExtra(DownloadService.EXTRA_EVENT_TYPE, DownloadService.EVENT_CANCEL);
	cancelIntent.putExtra(DownloadService.EXTRA_DOWNLOAD_URL, request.mDownloadUrl);

	PendingIntent cancelPendingIntent = PendingIntent.getService(context, 100, cancelIntent,
			PendingIntent.FLAG_CANCEL_CURRENT);
	remoteViews.setOnClickPendingIntent(R.id.noti_cancel, cancelPendingIntent);
	
	// 消息信息设置
	Notification notification = new Notification();
	notification.tickerText = request.mTitle;
	notification.icon = R.drawable.notification_icon;
	notification.contentView = remoteViews;
	// notification.flags = Notification.FLAG_AUTO_CANCEL;
	notification.flags = Notification.FLAG_ONGOING_EVENT;

	// 点击通知栏
	Intent intent = new Intent();
	intent.setAction("com.wo2b.download.AActivity");
	// intent.setClass(context, Download.class);

	notification.contentIntent = PendingIntent.getActivity(context, 1, intent, PendingIntent.FLAG_CANCEL_CURRENT);
	
	// 生成通知ID
	int notificationId = new Random().nextInt(10000);

	mNotificationManager.notify(notificationId, notification);
	
	request.mNotification = notification;
	request.mNotificationId = notificationId;

}
 
开发者ID:benniaobuguai,项目名称:android-project-gallery,代码行数:60,代码来源:DownloadService.java

示例8: innerStartActivity

import android.content.Intent; //导入方法依赖的package包/类
private static boolean innerStartActivity(Context context, Mapping mapping, Uri uri, String url, boolean isDeeplink)
{
    if(mapping.getTargetActivity() == null) return false;

    Intent intent = new Intent();

    intent.setClass(context, mapping.getTargetActivity());

    intent.setData(uri);

    intent.putExtras(mapping.parseExtras(url));

    if(!(context instanceof Activity))
    {
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    }

    context.startActivity(intent);

    ActivityRoutingStatus activityRoutingStatus = mActivityRoutingStatusMap.get(mapping.getTargetActivity());

    if(activityRoutingStatus == null)
    {
        mActivityRoutingStatusMap.put(mapping.getTargetActivity(), new ActivityRoutingStatus(isDeeplink, mapping.getParentActivityHost()));
    }
    else
    {
        activityRoutingStatus.isActivityLinkedByDeeplink = true;
    }

    return true;
}
 
开发者ID:kfrozen,项目名称:DeeplinkRouter,代码行数:33,代码来源:DPRouter.java

示例9: actionReschedulePoll

import android.content.Intent; //导入方法依赖的package包/类
public static void actionReschedulePoll(Context context, Integer wakeLockId) {
    Intent i = new Intent();
    i.setClass(context, MailService.class);
    i.setAction(MailService.ACTION_RESCHEDULE_POLL);
    addWakeLockId(context, i, wakeLockId, true);
    Utils.startServicePossiblyInForeground(context, i);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:8,代码来源:MailService.java

示例10: gotoWelcomeActivity

import android.content.Intent; //导入方法依赖的package包/类
/**
 * Go to guide activity.
 */
private void gotoWelcomeActivity()
{
	Intent intent = new Intent();
	intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
	intent.setClass(this, WelcomeActivity.class);
	startActivity(intent);
	
	finish();
}
 
开发者ID:benniaobuguai,项目名称:android-project-gallery,代码行数:13,代码来源:SplashActivity.java

示例11: startActivityForResult

import android.content.Intent; //导入方法依赖的package包/类
/**
 * [含有Bundle通过Class打开编辑界面]
 *
 * @param clz         要跳转的Activity
 * @param bundle      bundel数据
 * @param requestCode requestCode
 */
public void startActivityForResult(Class<?> clz, Bundle bundle,
                                   int requestCode) {
    Intent intent = new Intent();
    intent.setClass(this, clz);
    if (bundle != null) {
        intent.putExtras(bundle);
    }
    startActivityForResult(intent, requestCode);
    if (isTransAnim)
        overridePendingTransition(R.anim.activity_start_zoom_in, R.anim
                .activity_start_zoom_out);
}
 
开发者ID:Horrarndoo,项目名称:YiZhi,代码行数:20,代码来源:BaseCompatActivity.java

示例12: onClick

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.tag_a_photo:
            Intent photoToBeTagged = new Intent(Intent.ACTION_PICK,
                    android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            startActivityForResult(photoToBeTagged, CHOOSE_A_PHOTO_TO_BE_TAGGED);
            break;
        case R.id.see_tagged_photos:
            if (!InstaTagSampleApplication.getInstance().getTaggedPhotos().isEmpty()) {
                Intent taggedPhotos = new Intent();
                taggedPhotos.setClass(InstaActivity.this, TaggedPhotoActivity.class);
                startActivity(taggedPhotos);
            } else {
                Toast.makeText(this, NO_PHOTO_TAGGED, Toast.LENGTH_SHORT).show();
            }
            break;
        case R.id.see_some_ones:
            Intent someOnes = new Intent();
            someOnes.setClass(InstaActivity.this, SomeOneActivity.class);
            startActivity(someOnes);
            break;
        case R.id.drag_test:
            Intent dragTest = new Intent();
            dragTest.setClass(InstaActivity.this, DragTestActivity.class);
            startActivity(dragTest);
            break;
        default:
            break;
    }
}
 
开发者ID:harsh159357,项目名称:InstaTag,代码行数:32,代码来源:InstaActivity.java

示例13: onClick

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onClick() {
    Intent intent = new Intent();
    intent.setClass(this, ScreenCaptureActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivityAndCollapse(intent);
}
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:8,代码来源:ScreenCaptureTile.java

示例14: start

import android.content.Intent; //导入方法依赖的package包/类
public static void start(Context context, String id) {
    Intent intent = new Intent();
    intent.putExtra("id", id);
    intent.setClass(context, VideoDetailActivity.class);
    context.startActivity(intent);
}
 
开发者ID:Longalei,项目名称:Edu,代码行数:7,代码来源:VideoDetailActivity.java

示例15: start

import android.content.Intent; //导入方法依赖的package包/类
public static void start(Context context, String tid) {
    Intent intent = new Intent();
    intent.putExtra(EXTRA_ID, tid);
    intent.setClass(context, AdvancedTeamInfoActivity.class);
    context.startActivity(intent);
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:7,代码来源:AdvancedTeamInfoActivity.java


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