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


Java ConfirmationActivity类代码示例

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


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

示例1: snoozeAlarm

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
private void snoozeAlarm() {
    Intent intent = new Intent(this, ConfirmationActivity.class);
    intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE,
            ConfirmationActivity.SUCCESS_ANIMATION);
    intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE,
            getString(R.string.alarm_snoozed));
    startActivity(intent);

    Intent alarmActivityIntent = new Intent(this, AlarmActivity.class);
    alarmActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    alarmActivityIntent.putExtra(AlarmActivity.EXTRA_ALARM_COMMAND_BYTES, ParcelPacker.getData(alarmCommand));
    startActivity(alarmActivityIntent);

    PendingIntent alarmPendingIntent = PendingIntent.getActivity(this, 0, alarmActivityIntent, PendingIntent.FLAG_UPDATE_CURRENT);
    AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
    alarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + alarmCommand.getSnoozeDuration(), alarmPendingIntent);

    finish();
}
 
开发者ID:matejdro,项目名称:WearVibrationCenter,代码行数:20,代码来源:AlarmActivity.java

示例2: onPostExecute

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
@Override
protected void onPostExecute(Boolean success) {
    Intent intent = new Intent(TimedMuteActivity.this, ConfirmationActivity.class);

    if (success) {
        intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE,
                ConfirmationActivity.SUCCESS_ANIMATION);
        intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE,
                getString(R.string.timed_mute_success));
    } else {
        intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE,
                ConfirmationActivity.FAILURE_ANIMATION);
        intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE,
                getString(R.string.timed_mute_fail));

    }

    startActivity(intent);
    finish();
}
 
开发者ID:matejdro,项目名称:WearVibrationCenter,代码行数:21,代码来源:TimedMuteActivity.java

示例3: onPostExecute

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
@Override
protected void onPostExecute(Boolean success) {
    Intent intent = new Intent(AppMuteActivity.this, ConfirmationActivity.class);

    if (success) {
        intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE,
                ConfirmationActivity.SUCCESS_ANIMATION);
        intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE,
                getString(R.string.app_muted));
    } else {
        intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE,
                ConfirmationActivity.FAILURE_ANIMATION);
        intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE,
                getString(R.string.timed_mute_fail));

    }

    startActivity(intent);
    finish();
}
 
开发者ID:matejdro,项目名称:WearVibrationCenter,代码行数:21,代码来源:AppMuteActivity.java

示例4: onButtonClicked

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
private void onButtonClicked()
{
    PendingResult<DataApi.DataItemResult> pendingResult = Message.sendActionMessage(mGoogleApiClient);
    pendingResult.setResultCallback(new ResultCallback<DataApi.DataItemResult>() {
        @Override
        public void onResult(@NonNull DataApi.DataItemResult dataItemResult) {
            Message.emptyActionMessage(mGoogleApiClient);
        }
    });

    Intent intent = new Intent(this, ConfirmationActivity.class);
    intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE,
            ConfirmationActivity.SUCCESS_ANIMATION);
    intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE,
            getString(R.string.action_sent));
    startActivity(intent);
}
 
开发者ID:Parrot-Developers,项目名称:DronesWear,代码行数:18,代码来源:MainActivity.java

示例5: onTimerFinished

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
@Override
public void onTimerFinished(View view) {
    Intent intent = new Intent(this, ConfirmationActivity.class);
    intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.SUCCESS_ANIMATION);
    switch (mActionMode) {
        case ACTION_MODE_CLOSE_SUNROOF:
            EventBus.getDefault().post(new ToHandHoldRequestEvent(WEAR_CLOSE_SUNROOF));
            intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, getString(R.string.notification_bad_weather_confirmation_done));
            break;
        case ACTION_MODE_LOCK_DOOR:
            EventBus.getDefault().post(new ToHandHoldRequestEvent(WEAR_ACTION_DOOR_LOCK));
            intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, getString(R.string.notification_car_unlocked_confirmation_done));
            break;
        case ACTION_MODE_START_CHARGING:
            EventBus.getDefault().post(new ToHandHoldRequestEvent(WEAR_ACTION_CHARGING_START));
            intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, getString(R.string.notification_unexpected_charge_stop_confirmation_done));
            break;
    }
    startActivity(intent);
    finish();
}
 
开发者ID:eleks,项目名称:rnd-android-wear-tesla,代码行数:22,代码来源:ConfirmationNotificationActivity.java

示例6: onStartCommand

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startId) {

    if (intent != null && intent.getAction() != null) {
        if ("open_ticket".equals(intent.getAction())) {
            final Ticket t = (Ticket)intent.getExtras().getSerializable("ticket");
            sendMessage("openTicket/" + t.getId(), null);

            Intent confirmationIntent = new Intent(this, ConfirmationActivity.class);
            confirmationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
            confirmationIntent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.OPEN_ON_PHONE_ANIMATION);
            startActivity(confirmationIntent);
        }
    }

    return super.onStartCommand(intent, flags, startId);
}
 
开发者ID:avast,项目名称:sms-ticket,代码行数:18,代码来源:ListenerService.java

示例7: performActionWhenConnected

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
public static void performActionWhenConnected (final Activity context, GoogleApiClient.ConnectionCallbacks action)
{
    if (mGoogleApiClient != null && mGoogleApiClient.isConnected())
    {
        action.onConnected(null);
    }
    else {
        mGoogleApiClient = new GoogleApiClient.Builder(context)
                .addConnectionCallbacks(action)
                .addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {
                    @Override
                    public void onConnectionFailed(ConnectionResult result) {
                        Intent intent = new Intent(context, ConfirmationActivity.class);
                        intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.FAILURE_ANIMATION);

                        context.startActivity(intent);
                    }
                })
                .addApi(Wearable.API)
                .build();
        mGoogleApiClient.connect();
    }
}
 
开发者ID:RSenApps,项目名称:Commandr-Android,代码行数:24,代码来源:WearUtil.java

示例8: sendMessage

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
@Override
    public void sendMessage(String path, @Nullable byte[] data) {
        Log.v(TAG, String.format("...to node %s", mobileNodeId));
        Wearable.MessageApi.sendMessage(googleApiClient, mobileNodeId, path, data).setResultCallback(new ResultCallback<MessageApi.SendMessageResult>() {
            @Override
            public void onResult(MessageApi.SendMessageResult sendMessageResult) {
            if (sendMessageResult.getStatus().isSuccess()) {
                Log.v(TAG, "Successful send");
//                intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.SUCCESS_ANIMATION);
//                intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, mActivity.getString(R.string.message_sent));
            } else {
                Log.v(TAG, "Send error");
                Intent intent = new Intent(mActivity.getApplicationContext(), ConfirmationActivity.class);
                intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.FAILURE_ANIMATION);
                intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, mActivity.getString(R.string.send_error));
                mActivity.startActivity(intent);
            }
            }
        });
    }
 
开发者ID:tonyalpskog,项目名称:OpenHAB_Room_Flipper,代码行数:21,代码来源:MobileCommunicator.java

示例9: onTimerFinished

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
@Override
public void onTimerFinished(View view) {
    mIsAnimating = false;
    final Activity activity = getActivity();
    if (activity == null) {
        Log.e(TAG_LOG, "Fragment not attached anymore to the activity (Skipping action).");
        return;
    }
    // Updating the book state
    final long bookId = getArguments().getLong(ARG_ID);
    BookService.Invoker.get(activity).bookId(bookId).owned(true).invoke();
    // Starting the confirmation screen
    Intent intent = new Intent(activity, ConfirmationActivity.class);
    intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.SUCCESS_ANIMATION);
    intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, getString(R.string.item_purchased));
    startActivity(intent);
    activity.finish();
}
 
开发者ID:SimoneCasagranda,项目名称:android-wear-tutorial,代码行数:19,代码来源:BuyBookFragment.java

示例10: getOpenOnPhonePendingIntent

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
private PendingIntent getOpenOnPhonePendingIntent(String permalink,
                                                  boolean openOnPhoneDismisses,
                                                  int notificationId) {
    Intent openOnPhone = new Intent(this, ActionReceiver.class);
    openOnPhone.putExtra(Constants.KEY_PATH, Constants.PATH_OPEN_ON_PHONE);
    openOnPhone.putExtra(Constants.KEY_CONFIRMATION_MESSAGE, getString(R.string.open_on_phone));
    openOnPhone.putExtra(Constants.KEY_CONFIRMATION_ANIMATION,
            ConfirmationActivity.SUCCESS_ANIMATION);
    openOnPhone.putExtra(Constants.KEY_POST_PERMALINK, permalink);
    openOnPhone.putExtra(Constants.KEY_DISMISS_AFTER_ACTION, openOnPhoneDismisses);
    openOnPhone.putExtra(Constants.KEY_NOTIFICATION_ID, notificationId);
    return PendingIntent.getBroadcast(this,
            REQUEST_CODE_OPEN_ON_PHONE + notificationId,
            openOnPhone,
            PendingIntent.FLAG_UPDATE_CURRENT);
}
 
开发者ID:emmaguy,项目名称:wear-notify-for-reddit,代码行数:17,代码来源:NotificationListenerService.java

示例11: onTimerFinished

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
@Override
public void onTimerFinished(View view) {
    // save only if user hasn't canceled
    if(!this.isFinishing()) {
        saveClimb();

        String savedString = getString(R.string.climb_saved, routeGradeLabelToSave);

        Intent intent = new Intent(this, ConfirmationActivity.class);
        intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.SUCCESS_ANIMATION);
        intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, savedString);
        startActivity(intent);
    }
    finish();
}
 
开发者ID:google,项目名称:climb-tracker,代码行数:16,代码来源:ClimbConfirmation.java

示例12: showOpenOnPhoneAnimation

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
private void showOpenOnPhoneAnimation() {
    Intent intent = new Intent(this, ConfirmationActivity.class);
    intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, ConfirmationActivity.OPEN_ON_PHONE_ANIMATION);
    intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, getString(R.string.notification_openedOnPhone));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);
}
 
开发者ID:BoD,项目名称:DoorCodeNotifier,代码行数:8,代码来源:NotificationIntentService.java

示例13: onSuccess

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
@Override
public void onSuccess() {
    final Intent intent = new Intent(ControlActivity.this, ConfirmationActivity.class);
    intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE,
            ConfirmationActivity.SUCCESS_ANIMATION);
    intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, getString(R.string.sound_profile_change_confirmation));

    startActivity(intent);
    finish();
}
 
开发者ID:tobiasheine,项目名称:WearControl,代码行数:11,代码来源:ControlActivity.java

示例14: onFailure

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
@Override
public void onFailure() {
    final Intent intent = new Intent(ControlActivity.this, ConfirmationActivity.class);
    intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE,
            ConfirmationActivity.FAILURE_ANIMATION);
    intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, getString(R.string.sound_profile_change_failure));

    startActivity(intent);
}
 
开发者ID:tobiasheine,项目名称:WearControl,代码行数:10,代码来源:ControlActivity.java

示例15: startAction

import android.support.wearable.activity.ConfirmationActivity; //导入依赖的package包/类
/**
 * Use the Wear Message API to execute an action. Clears local and remote notifications and
 * also runs a confirmation animation before finishing the Wear activity.
 *
 * @param attraction The attraction to start the action on
 * @param pathName The Wear Message API pathname
 * @param confirmAnimationType The confirmation animation type from ConfirmationActivity
 */
private void startAction(Attraction attraction, String pathName, int confirmAnimationType) {
    Intent intent = new Intent(mActivity, ConfirmationActivity.class);
    intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE, confirmAnimationType);
    mActivity.startActivity(intent);

    UtilityService.clearNotification(mActivity);
    UtilityService.clearRemoteNotifications(mActivity);
    UtilityService.startDeviceActivity(mActivity, pathName, attraction.name, attraction.city);

    ((Activity) mActivity).finish();
}
 
开发者ID:googlesamples,项目名称:io2015-codelabs,代码行数:20,代码来源:AttractionsGridPagerAdapter.java


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