本文整理匯總了Java中org.thoughtcrime.securesms.RegistrationActivity類的典型用法代碼示例。如果您正苦於以下問題:Java RegistrationActivity類的具體用法?Java RegistrationActivity怎麽用?Java RegistrationActivity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RegistrationActivity類屬於org.thoughtcrime.securesms包,在下文中一共展示了RegistrationActivity類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: PushRegistrationReminder
import org.thoughtcrime.securesms.RegistrationActivity; //導入依賴的package包/類
public PushRegistrationReminder(final Context context, final MasterSecret masterSecret) {
super(context.getString(R.string.reminder_header_push_title),
context.getString(R.string.reminder_header_push_text));
final OnClickListener okListener = new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, RegistrationActivity.class);
intent.putExtra("master_secret", masterSecret);
intent.putExtra("cancel_button", true);
context.startActivity(intent);
}
};
setOkListener(okListener);
}
示例2: onPreferenceChange
import org.thoughtcrime.securesms.RegistrationActivity; //導入依賴的package包/類
@Override
public boolean onPreferenceChange(final Preference preference, Object newValue) {
if (((CheckBoxPreference)preference).isChecked()) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setIconAttribute(R.attr.dialog_info_icon);
builder.setTitle(R.string.ApplicationPreferencesActivity_disable_signal_messages_and_calls);
builder.setMessage(R.string.ApplicationPreferencesActivity_disable_signal_messages_and_calls_by_unregistering);
builder.setNegativeButton(android.R.string.cancel, null);
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
new DisablePushMessagesTask((CheckBoxPreference)preference).execute();
}
});
builder.show();
} else {
Intent nextIntent = new Intent(getActivity(), ApplicationPreferencesActivity.class);
Intent intent = new Intent(getActivity(), RegistrationActivity.class);
intent.putExtra("cancel_button", true);
intent.putExtra("next_intent", nextIntent);
intent.putExtra("master_secret", masterSecret);
startActivity(intent);
}
return false;
}