@Override
  protected void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);
    ((TextSwitcher) findViewById(R.id.trucoAnnotator_scoreTeam1))
        .setText(savedInstanceState.getCharSequence(SCORE_TEAM_1));
    ((TextSwitcher) findViewById(R.id.trucoAnnotator_scoreTeam2))
        .setText(savedInstanceState.getCharSequence(SCORE_TEAM_2));

    boolean isTeamEnabled = savedInstanceState.getBoolean(TEAM_1_STATUS);
    if (!isTeamEnabled) {
      List<Integer> controlsId = new ArrayList<Integer>();
      controlsId.add(R.id.trucoAnnotator_labelTeam1);
      controlsId.add(R.id.trucoAnnotator_scoreTeam1);
      controlsId.add(R.id.trucoAnnotator_substractButtonTeam1);
      disableControls(controlsId);
    }

    isTeamEnabled = savedInstanceState.getBoolean(TEAM_2_STATUS);
    if (!isTeamEnabled) {
      List<Integer> controlsId = new ArrayList<Integer>();
      controlsId.add(R.id.trucoAnnotator_labelTeam2);
      controlsId.add(R.id.trucoAnnotator_scoreTeam2);
      controlsId.add(R.id.trucoAnnotator_substractButtonTeam2);
      disableControls(controlsId);
    }
  }
 public final Dialog onCreateDialog(Bundle bundle) {
   Bundle bundle1 = getArguments();
   android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(getActivity());
   builder.setTitle(bundle1.getCharSequence("title"));
   builder.setMessage(bundle1.getCharSequence("message"));
   builder.setPositiveButton(bundle1.getCharSequence("positive"), this);
   return builder.create();
 }
  @Override
  public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    setTheme(android.R.style.Theme_Dialog);
    setContentView(R.layout.simple_input_activity);

    Bundle extras = getIntent().getExtras();

    CharSequence title = extras.getCharSequence(EXTRA_TITLE);
    if (title != null) {
      setTitle(title);
    } else {
      setTitle(R.string.default_input_title);
    }

    CharSequence prompt = extras.getCharSequence(EXTRA_PROMPT);
    mPrompt = (TextView) findViewById(R.id.prompt);
    if (prompt != null) {
      mPrompt.setText(prompt);
    } else {
      mPrompt.setVisibility(View.GONE);
    }

    mEdit = (EditText) findViewById(R.id.edit);
    CharSequence defaultText = extras.getCharSequence(EXTRA_DEFAULT_CONTENT);
    if (defaultText != null) {
      mEdit.setText(defaultText);
    }

    mBtnOk = (Button) findViewById(R.id.btnOk);
    mBtnOk.setOnClickListener(
        new Button.OnClickListener() {
          public void onClick(View v) {
            setResult(RESULT_OK, (new Intent()).setAction(mEdit.getText().toString()));
            finish();
          }
        });
    CharSequence okText = extras.getCharSequence(EXTRA_OK_BUTTON_TEXT);
    if (okText != null) {
      mBtnOk.setText(okText);
    }

    mBtnCancel = (Button) findViewById(R.id.btnCancel);
    mBtnCancel.setOnClickListener(
        new Button.OnClickListener() {
          public void onClick(View v) {
            finish();
          }
        });

    // XXX Hack from GoogleLogin.java. The android:layout_width="match_parent"
    // defined in the layout xml doesn't seem to work for LinearLayout.
    getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
  }
Beispiel #4
0
 @Override
 public void onReceive(Context context, Intent intent) {
   Bundle bundle = intent.getExtras();
   switch ((String) bundle.getCharSequence("action")) {
     case "refresh":
       refreshFragment();
       break;
     case "uartCMD":
       MVC_control_handler((String) bundle.getCharSequence("cmd"));
       break;
   }
 }
    private void processArguments() {
      Bundle arguments = getArguments();

      // Key.
      mPreferenceKey = arguments.getString(EXTRA_PREFERENCE_KEY);

      // Enabled.
      final boolean enabled = arguments.getBoolean(EXTRA_CHECKED);
      mToggleSwitch.setCheckedInternal(enabled);

      // Title.
      PreferenceActivity activity = (PreferenceActivity) getActivity();
      if (!activity.onIsMultiPane() || activity.onIsHidingHeaders()) {
        mOldActivityTitle = getActivity().getTitle();
        String title = arguments.getString(EXTRA_TITLE);
        getActivity().getActionBar().setTitle(title);
      }

      // Summary.
      String summary = arguments.getString(EXTRA_SUMMARY);
      mSummaryPreference.setSummary(summary);

      // Settings title and intent.
      String settingsTitle = arguments.getString(EXTRA_SETTINGS_TITLE);
      String settingsComponentName = arguments.getString(EXTRA_SETTINGS_COMPONENT_NAME);
      if (!TextUtils.isEmpty(settingsTitle) && !TextUtils.isEmpty(settingsComponentName)) {
        Intent settingsIntent =
            new Intent(Intent.ACTION_MAIN)
                .setComponent(ComponentName.unflattenFromString(settingsComponentName.toString()));
        if (!getPackageManager().queryIntentActivities(settingsIntent, 0).isEmpty()) {
          mSettingsTitle = settingsTitle;
          mSettingsIntent = settingsIntent;
          setHasOptionsMenu(true);
        }
      }

      // Enable warning title.
      mEnableWarningTitle =
          arguments.getCharSequence(AccessibilitySettings.EXTRA_ENABLE_WARNING_TITLE);

      // Enable warning message.
      mEnableWarningMessage =
          arguments.getCharSequence(AccessibilitySettings.EXTRA_ENABLE_WARNING_MESSAGE);

      // Disable warning title.
      mDisableWarningTitle = arguments.getString(AccessibilitySettings.EXTRA_DISABLE_WARNING_TITLE);

      // Disable warning message.
      mDisableWarningMessage =
          arguments.getString(AccessibilitySettings.EXTRA_DISABLE_WARNING_MESSAGE);
    }
 @Override
 public Dialog onCreateDialog(Bundle savedInstanceState) {
   final Bundle bundle = getArguments();
   Activity ctx = getActivity();
   AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
   int title = bundle.getInt(KEY_TITLE, 0);
   if (title != 0) {
     builder.setTitle(title);
   }
   builder.setMessage(bundle.getCharSequence(KEY_MESSAGE));
   int checkboxLabel = bundle.getInt(KEY_CHECKBOX_LABEL, 0);
   if (bundle.getString(KEY_PREFKEY) != null || checkboxLabel != 0) {
     //noinspection InflateParams
     View cb = LayoutInflater.from(ctx).inflate(R.layout.checkbox, null);
     checkBox = (CheckBox) cb.findViewById(R.id.checkbox);
     checkBox.setText(
         checkboxLabel != 0 ? checkboxLabel : R.string.confirmation_dialog_dont_show_again);
     builder.setView(cb);
   }
   int positiveLabel = bundle.getInt(KEY_POSITIVE_BUTTON_LABEL);
   int negativeLabel = bundle.getInt(KEY_NEGATIVE_BUTTON_LABEL);
   builder.setPositiveButton(positiveLabel == 0 ? android.R.string.ok : positiveLabel, this);
   builder.setNegativeButton(negativeLabel == 0 ? android.R.string.cancel : negativeLabel, this);
   return builder.create();
 }
 private String obterTextoFalado(Intent intent) {
   Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
   if (remoteInput != null) {
     return remoteInput.getCharSequence(EXTRA_RESPOSTA_VOZ).toString();
   }
   return null;
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_survey);

    Bundle b = getIntent().getExtras();
    pId = b.getInt("PLACE_ID");
    depName = (String) b.getCharSequence("DEPENDENCY_NAME");
    depId = b.getInt("DEPENDENT_ID");

    if (depName != null) {
      mSurveyAdapter =
          SurveyAdapterBuilder.getDependentAdapter(this, pId, depId, depName, getFragmentManager());
    } else {
      mSurveyAdapter = SurveyAdapterBuilder.BuildAdapter(this, pId, getFragmentManager());
    }
    // Set up the ViewPager with the sections adapter.
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mSurveyAdapter);

    // mViewPager.setOnPageChangeListener(new MyPageChangeListener());

    // Bind the title indicator to the adapter
    CirclePageIndicator titleIndicator = (CirclePageIndicator) findViewById(R.id.titles);
    titleIndicator.setViewPager(mViewPager);
    titleIndicator.setOnPageChangeListener(new MyPageChangeListener());
  }
Beispiel #9
0
 private CharSequence getMessageText(Intent intent) {
   Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
   if (remoteInput != null) {
     return remoteInput.getCharSequence(EXTRA_VOICE_REPLY);
   }
   return null;
 }
Beispiel #10
0
 private CharSequence getValue(String key) {
   CharSequence val = bundle.getCharSequence(key);
   if (val == null) {
     val = NO_VALUE;
   }
   return val;
 }
Beispiel #11
0
 @Override
 protected void onRestoreInstanceState(Bundle savedInstanceState) {
   // Log.d(Tools.TAG, "onRestoreInstanceState");
   super.onRestoreInstanceState(savedInstanceState);
   _logTextView.setText(savedInstanceState.getCharSequence("_logTextView"));
   // Append any text saved in service's internal buffer
   updateLog(null);
 }
Beispiel #12
0
 @Override
 public void onRestoreInstanceState(Bundle savedInstanceState) {
   super.onRestoreInstanceState(savedInstanceState);
   if (savedInstanceState.containsKey("irbOutput"))
     irbOutput.setText(savedInstanceState.getCharSequence("irbOutput"));
   irbInput.onRestoreInstanceState(savedInstanceState);
   if (savedInstanceState.containsKey("tab")) tabs.setCurrentTab(savedInstanceState.getInt("tab"));
 }
Beispiel #13
0
 public final Dialog c(Bundle paramBundle) {
   Bundle localBundle = this.m;
   Context localContext = ar_();
   un localun = new un(localContext);
   View localView = LayoutInflater.from(localContext).inflate(efj.ZQ, null);
   this.Z = ((EditText) localView.findViewById(aw.eK));
   this.Z.addTextChangedListener(this);
   CharSequence localCharSequence1 = localBundle.getCharSequence("hint_text");
   if (localCharSequence1 != null) {
     this.Z.setHint(localCharSequence1);
   }
   this.aa = localBundle.getInt("max_length", 1000);
   if (this.aa > 0) {
     EditText localEditText = this.Z;
     InputFilter[] arrayOfInputFilter = new InputFilter[1];
     arrayOfInputFilter[0] = new InputFilter.LengthFilter(this.aa);
     localEditText.setFilters(arrayOfInputFilter);
   }
   if (paramBundle != null) {
     this.Z.setText(paramBundle.getCharSequence("text_value"));
   }
   for (; ; ) {
     String str1 = localBundle.getString("error_msg");
     if (str1 != null) {
       this.Z.setError(str1);
     }
     TextView localTextView = (TextView) localView.findViewById(aw.eJ);
     String str2 = localBundle.getString("notice_text");
     if (str2 != null) {
       localTextView.setText(str2);
       localTextView.setVisibility(0);
     }
     localun.a(localView);
     CharSequence localCharSequence2 = localBundle.getCharSequence("dialog_title");
     localun.a.e = localCharSequence2;
     localun.a(fi.b, this);
     localun.b(localBundle.getInt("cancel_resource_id", fi.a), this);
     ((ImageView) localView.findViewById(aw.eH)).setOnClickListener(new luz(this));
     this.Z.post(new lva(this, localBundle));
     return localun.a();
     this.Z.setText(localBundle.getCharSequence("text_value"));
   }
 }
  public void onRestoreInstanceState(Bundle savedInstanceState) {
    if (savedInstanceState != null) {
      mUndoMessage = savedInstanceState.getCharSequence("undo_message");
      mUndoToken = savedInstanceState.getParcelable("undo_token");

      if (mUndoToken != null || !TextUtils.isEmpty(mUndoMessage)) {
        showUndoBar(true, mUndoMessage, mUndoToken);
      }
    }
  }
Beispiel #15
0
  @Override
  protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
      Bundle bundle = (Bundle) state;
      mLabel.setVisibility(bundle.getInt(SAVED_LABEL_VISIBILITY));
      mHint = bundle.getCharSequence(SAVED_HINT);

      // retrieve super state
      state = bundle.getParcelable(SAVED_SUPER_STATE);
    }
    super.onRestoreInstanceState(state);
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_overview, container, false);
    mOverview = (TextView) rootView.findViewById(R.id.textView_detail_overview);

    if (savedInstanceState != null) {
      setOverview((String) savedInstanceState.getCharSequence(OVERVIEW_KEY));
    }

    return rootView;
  }
  public Dialog onCreateDialog(final Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog
        .getWindow()
        .setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    if (savedInstanceState != null) {
      parentItem = (String) savedInstanceState.getCharSequence("root");
    }

    return dialog;
  }
    /** During creation, if arguments have been supplied to the fragment then parse those out. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);

      Bundle args = getArguments();
      if (args != null) {
        CharSequence label = args.getCharSequence("label");
        if (label != null) {
          mLabel = label;
        }
      }
    }
  @Override
  protected void parseIntent(Context ctx, String action, Bundle bundle)
      throws IllegalArgumentException {
    Log.d(TAG, "Will read data from SEMC intent");

    setTimestamp(System.currentTimeMillis());

    CharSequence ar = bundle.getCharSequence("ARTIST_NAME");
    CharSequence al = bundle.getCharSequence("ALBUM_NAME");
    CharSequence tr = bundle.getCharSequence("TRACK_NAME");

    if (ar == null || tr == null) {
      throw new IllegalArgumentException("null track values");
    }

    Artist artist = Artist.get(ar.toString());
    Album album = null;
    if (al != null) {
      album = Album.get(al.toString(), artist);
    }
    Track track = Track.get(tr.toString(), album, artist);
    setTrack(track);
  }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
   mUserLearnedDrawer = sp.getBoolean(PREF_USER_LEARNED_DRAWER, false);
   if (savedInstanceState != null) {
     mCurrentSelectedPosition = savedInstanceState.getInt(STATE_SELECTED_POSITION);
     mTitle = savedInstanceState.getCharSequence(STATE_TITLE);
     mFromSavedInstanceState = true;
   }
   mStorageHelper =
       new StorageHelper(
           getActivity(),
           new StorageHelper.StateListener() {
             @Override
             public void onStateChanged(boolean available, boolean writeable) {}
           });
   mStorageHelper.startWatchingExternalStorage();
 }
 @NonNull
 @Override
 public Dialog onCreateDialog(final Bundle savedInstanceState) {
   final Context wrapped = ThemeUtils.getDialogThemedContext(getActivity());
   final AlertDialog.Builder builder = new AlertDialog.Builder(wrapped);
   final View view =
       LayoutInflater.from(wrapped).inflate(R.layout.dialog_auto_complete_textview, null);
   builder.setView(view);
   mEditText = (AutoCompleteTextView) view.findViewById(R.id.edit_text);
   if (savedInstanceState != null) {
     mEditText.setText(savedInstanceState.getCharSequence(EXTRA_TEXT));
   }
   mUserAutoCompleteAdapter = new ComposeAutoCompleteAdapter(wrapped);
   final Bundle args = getArguments();
   mUserAutoCompleteAdapter.setAccountId(args.getLong(EXTRA_ACCOUNT_ID));
   mEditText.setAdapter(mUserAutoCompleteAdapter);
   mEditText.setThreshold(1);
   mEditText.setFilters(new InputFilter[] {new InputFilter.LengthFilter(20)});
   builder.setTitle(R.string.screen_name);
   builder.setPositiveButton(android.R.string.ok, this);
   builder.setNegativeButton(android.R.string.cancel, this);
   return builder.create();
 }
  @SuppressLint("NewApi")
  @Override
  public void onNotificationPosted(StatusBarNotification sbn) {

    String pack = sbn.getPackageName();
    // String ticker = sbn.getNotification().tickerText.toString();
    Bundle extras = sbn.getNotification().extras;
    String title = extras.getString("android.title");
    String text = extras.getCharSequence("android.text").toString();

    Log.i("Package", pack);
    // Log.i("Ticker", ticker);
    Log.i("Title", title);
    Log.i("Text", text);

    Intent msgrcv = new Intent("Msg");
    msgrcv.putExtra("package", pack);
    // msgrcv.putExtra("ticker", ticker);
    msgrcv.putExtra("title", title);
    msgrcv.putExtra("text", text);

    LocalBroadcastManager.getInstance(context).sendBroadcast(msgrcv);
  }
Beispiel #23
0
 public CharSequence getCharSequence(Bundle bundle) {
   return bundle == null ? null : bundle.getCharSequence(getName());
 }
Beispiel #24
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_steprecording);

    // 手錶
    String fromwear = getIntent().getStringExtra("reply");
    if (fromwear == null) {
      Bundle remoteInput = RemoteInput.getResultsFromIntent(getIntent());
      if (remoteInput != null) {
        fromwear = remoteInput.getCharSequence(Steprecording.EXTRA_VOICE_REPLY).toString();
        Log.d("fromwear", fromwear);
        wearcontent = fromwear.split(" ");
        TAG_FROM_WEAR = true;
      }
    }

    TextView ss = (TextView) findViewById(R.id.textView6);
    Intent intent = this.getIntent();
    Bundle bundle = intent.getExtras(); // 取得Bundle

    /*//是否來過
    if(intent.hasExtra("TAG_BACK_TO_RECORDING")){
        TAG_BACK_TO_RECORDING = true;
        Log.d("抓3","backtorecording");
    }*/

    TAG_CASE_NUMBER = bundle.getString("TAG_CASE_NUMBER");
    TAG_STEP_NUMBER = bundle.getString("TAG_STEP_NUMBER");
    TAG_STEP_ORDER = bundle.getInt("TAG_STEP_ORDER");

    Log.d("StepRecording", TAG_STEP_NUMBER);
    //        TAG_CASE_NUMBER = "15";
    //        TAG_STEP_NUMBER = "10";
    //        TAG_STEP_ORDER = 1;
    ss.setText(Integer.toString(TAG_STEP_ORDER));

    // 是否來過
    DatabaseHelper mDBACK = DatabaseHelper.getHelper(this);
    case_recordDao mcase_recordDao = new case_recordDao();
    List<case_recordVo> listBACK = null;
    listBACK =
        mcase_recordDao.selectRaw(
            mDBACK, "Case_number=" + TAG_CASE_NUMBER + " and Step_order=" + TAG_STEP_ORDER);
    if (listBACK.size() != 0) {
      TAG_BACK_TO_RECORDING = true;
    }

    // Hashmap for ListView
    productsList = new ArrayList<HashMap<String, String>>();
    // Loading products in Background Thread
    // new LoadInput().execute();

    // SELECT record_order,record_text FROM step_record WHERE step_number='"+Stepnumber+"'"
    DatabaseHelper mDatabaseHelper = DatabaseHelper.getHelper(this);
    mstep_recordDao = new step_recordDao();
    List<step_recordVo> list = null;
    list = mstep_recordDao.selectRaw(mDatabaseHelper, "Step_number =\"" + TAG_STEP_NUMBER + "\"");

    //  Log.d("抓", list.get(0).getRecord_order());
    //  Log.d("抓2", list.get(0).getRecord_text());

    count = list.size();
    LinearLayout ly = (LinearLayout) findViewById(R.id.linearlayoutinput);
    for (int i = 0; i < count; i++) {
      TextView text1 = new TextView(Steprecording.this);
      text1.setText(list.get(i).getRecord_text() + "(" + list.get(i).getRecord_unit() + ")");
      // 1數字2文字
      if (Integer.valueOf(list.get(i).getRecord_type()) == 1) {
        text1.setText(
            text1.getText()
                + "("
                + list.get(i).getRecord_min()
                + "~"
                + list.get(i).getRecord_max()
                + ")");
      }

      edit1[i] = new EditText(Steprecording.this.getApplicationContext());
      edit1[i].setTextColor(Color.rgb(0, 0, 0));
      edit1[i].setOnFocusChangeListener(new MyOnFocusChangeListener());
      edit1[i].setSingleLine(true);
      edit1[i].setBackgroundColor(Color.parseColor("#FDDCB9")); // #FEFBE6黃
      if (TAG_FROM_WEAR) {
        if (i < wearcontent.length) {
          edit1[i].setText(wearcontent[i]);
        }
      }
      // edit1[0].setText("eee");
      ly.addView(text1);
      ly.addView(edit1[i]);
    }

    goright = (ImageButton) findViewById(R.id.imageButton);
    goleft = (ImageButton) findViewById(R.id.imageButton2);

    detector = new GestureDetector(new MySimpleOnGestureListener());

    ScrollView sv = (ScrollView) findViewById(R.id.scrollView);
    sv.setOnTouchListener(new MyOnTouchListener());
    // LinearLayout llb = (LinearLayout)findViewById(R.id.linearLayoutbackground);
    // llb.setOnTouchListener(new MyOnTouchListener());

    messageList = new ArrayList<>();

    // 手錶
    if (!TAG_BACK_TO_RECORDING) {
      String replyLabel = getResources().getString(R.string.reply_label);
      RemoteInput remoteInput =
          new RemoteInput.Builder(EXTRA_VOICE_REPLY).setLabel(replyLabel).build();
      // Create an intent for the reply action
      Intent replyIntent = new Intent(this, Steprecording.class);
      Bundle wb = new Bundle();
      wb.putString("TAG_CASE_NUMBER", TAG_CASE_NUMBER);
      wb.putString("TAG_STEP_NUMBER", TAG_STEP_NUMBER);
      wb.putInt("TAG_STEP_ORDER", TAG_STEP_ORDER);
      replyIntent.putExtras(wb);
      // replyIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
      PendingIntent replyPendingIntent =
          PendingIntent.getActivity(this, 0, replyIntent, PendingIntent.FLAG_UPDATE_CURRENT);

      NotificationCompat.Action action =
          new NotificationCompat.Action.Builder(
                  R.drawable.cast_ic_notification_0,
                  getString(R.string.reply_label),
                  replyPendingIntent)
              .addRemoteInput(remoteInput)
              .build();

      // Create builder for the main notification
      NotificationCompat.Builder notificationBuilder =
          new NotificationCompat.Builder(this)
              .setSmallIcon(R.mipmap.ic_launcher)
              .setContentTitle("Step" + Integer.toString(TAG_STEP_ORDER))
              .setContentText("紀錄項(請往左滑):");

      /*        // Create a big text style for the second page
              NotificationCompat.BigTextStyle secondPageStyle = new NotificationCompat.BigTextStyle();
              secondPageStyle.setBigContentTitle("Page 2")
                      .bigText("A lot of text...");

              // Create second page notification
              Notification secondPageNotification =
                      new NotificationCompat.Builder(this)
                              .setStyle(secondPageStyle)
                              .build();
      */
      List extras = new ArrayList();
      for (int i = 0; i < count; i++) {

        NotificationCompat.BigTextStyle extraPageStyle = new NotificationCompat.BigTextStyle();
        extraPageStyle
            .setBigContentTitle("第" + String.valueOf(i) + "項")
            .bigText(list.get(i).getRecord_text());
        Notification extraPageNotification =
            new NotificationCompat.Builder(this).setStyle(extraPageStyle).build();
        extras.add(extraPageNotification);
      }
      /*      //如果要跳頁
              Intent mainIntent = new Intent(this, MyDisplayActivity.class);
              PendingIntent mainPendingIntent = PendingIntent.getActivity(this, 0,
                      mainIntent, PendingIntent.FLAG_CANCEL_CURRENT);
      */

      // Extend the notification builder with the second page
      Notification notification =
          notificationBuilder
              .extend(new NotificationCompat.WearableExtender().addPages(extras).addAction(action))
              // .addPage(secondPageNotification))
              // .addAction(android.R.drawable.ic_media_play, "Speak", mainPendingIntent)
              .build();

      // Issue the notification
      NotificationManagerCompat notificationManager =
          NotificationManagerCompat.from(getApplication());
      Random random = new Random();
      int notificationId = random.nextInt(9999 - 1000) + 1000;
      notificationManager.notify(notificationId, notification);

      /*        mGoogleApiClient = new GoogleApiClient.Builder(this)
              .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {
                  @Override
                  public void onConnected(Bundle connectionHint) {
                      Log.d(TAG, "onConnected: " + connectionHint);
                  }
                  @Override
                  public void onConnectionSuspended(int cause) {
                      Log.d(TAG, "onConnectionSuspended: " + cause);
                  }
              })
              .addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {
                  @Override
                  public void onConnectionFailed(ConnectionResult result) {
                      Log.d(TAG, "onConnectionFailed: " + result);
                  }
              })
              .addApi(Wearable.API)
              .build();
      mGoogleApiClient.connect();
      sendNotification();*/
    }
  }
 private void proposeRestoreFromBundle(Bundle b) {
   if (b != null && b.containsKey(EXTRA_FILTER_CONSTRAINT)) {
     filter(b.getCharSequence(EXTRA_FILTER_CONSTRAINT));
   }
 }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.read_review_view);
    Bundle bundle = getIntent().getExtras();
    int reviewID = bundle.getInt("reviewID");
    String restaurantName = (String) bundle.getCharSequence("restaurantName");
    String id = Integer.toString(reviewID);

    TextView reviewHeader = (TextView) findViewById(R.id.review_header);
    TextView authorHeader = (TextView) findViewById(R.id.review_author);
    TextView reviewText = (TextView) findViewById(R.id.review_text);
    RatingBar rate = (RatingBar) findViewById(R.id.ratingbar_Indicator);
    RatingBar wheatrate = (RatingBar) findViewById(R.id.ratingbar_Indicator_wheat);
    RatingBar glutenrate = (RatingBar) findViewById(R.id.ratingbar_Indicator_gluten);
    RatingBar dairyrate = (RatingBar) findViewById(R.id.ratingbar_Indicator_dairy);
    RatingBar nutrate = (RatingBar) findViewById(R.id.ratingbar_Indicator_nut);

    List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
    nameValuePairs.add(new BasicNameValuePair("id", id));

    String response = null;
    TaskAsyncHttpPost httpRequest = new TaskAsyncHttpPost(nameValuePairs, ReviewDetailView.this);
    try {
      response = httpRequest.execute("http://maeverooney.x10.mx/getOneReview.php").get();
      String str = response.replace(":null", ":\"0\"");
      response = str;
    } catch (InterruptedException e3) {
      // TODO Auto-generated catch block
      e3.printStackTrace();
    } catch (ExecutionException e3) {
      // TODO Auto-generated catch block
      e3.printStackTrace();
    }
    if (response != null) {
      JSONArray myArray = null;
      JSONObject reviewObject = null;
      try {
        myArray = new JSONArray(response);
      } catch (JSONException e) {
        e.printStackTrace();
      }
      try {
        reviewObject = myArray.getJSONObject(0);
      } catch (JSONException e) {
        e.printStackTrace();
      }
      if (reviewObject != null) {
        try {
          reviewHeader.setText("Review For: " + restaurantName);
          String authorName = reviewObject.getString("username");
          authorHeader.setText("Author: " + authorName);
          String review = reviewObject.getString("text");
          reviewText.setText(review);
          float rating = Float.parseFloat(reviewObject.getString("overallRating"));
          float wheatrating = Float.parseFloat(reviewObject.getString("wheatRating"));
          float glutenrating = Float.parseFloat(reviewObject.getString("glutenRating"));
          float dairyrating = Float.parseFloat(reviewObject.getString("dairyRating"));
          float nutrating = Float.parseFloat(reviewObject.getString("nutRating"));
          rate.setRating(rating);
          wheatrate.setRating(wheatrating);
          glutenrate.setRating(glutenrating);
          dairyrate.setRating(dairyrating);
          nutrate.setRating(nutrating);
        } catch (JSONException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
    }
  }
 /**
  * Retrieve extended data from the request.
  *
  * @param name The name of the desired item.
  * @return the value of an item that previously added with putExtra() or null if no CharSequence
  *     value was found.
  * @see #putExtra(String, CharSequence)
  */
 public CharSequence getCharSequenceExtra(String name) {
   return mExtras == null ? null : mExtras.getCharSequence(name);
 }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_editor, container, false);

    Log.i("enter...", "new editor");
    // Setup hiding the action bar when the soft keyboard is displayed for narrow viewports
    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE
        && !getResources().getBoolean(R.bool.is_large_tablet_landscape)) {
      mHideActionBarOnSoftKeyboardUp = true;
    }

    mWaitingMediaFiles = new ConcurrentHashMap<>();
    // mUploadingMediaIds = new HashSet<>();
    mFailedMediaIds = new HashSet<>();

    // -- WebView configuration

    mWebView = (EditorWebViewAbstract) view.findViewById(R.id.webview);

    mWebView.setOnTouchListener(this);
    mWebView.setOnImeBackListener(this);

    LeaWebViewClient webViewClient = new LeaWebViewClient();
    webViewClient.setImageLoadListener(this);
    // mWebView.setWebViewClient(webViewClient);

    // Ensure that the content field is always filling the remaining screen space
    mWebView.addOnLayoutChangeListener(
        new View.OnLayoutChangeListener() {
          @Override
          public void onLayoutChange(
              View v,
              int left,
              int top,
              int right,
              int bottom,
              int oldLeft,
              int oldTop,
              int oldRight,
              int oldBottom) {
            mWebView.post(
                new Runnable() {
                  @Override
                  public void run() {
                    // mWebView.execJavaScriptFromString("ZSSEditor.init()");
                    mWebView.execJavaScriptFromString("ZSSEditor.refreshVisibleViewportSize();");
                  }
                });
          }
        });

    mEditorFragmentListener.onEditorFragmentInitialized();

    initJsEditor();

    if (savedInstanceState != null) {
      setTitle(savedInstanceState.getCharSequence(KEY_TITLE));
      setContent(savedInstanceState.getCharSequence(KEY_CONTENT));
    }

    // -- HTML mode configuration

    mSourceView = view.findViewById(R.id.sourceview);
    mSourceViewTitle = (SourceViewEditText) view.findViewById(R.id.sourceview_title);
    mSourceViewContent = (SourceViewEditText) view.findViewById(R.id.sourceview_content);

    // Toggle format bar on/off as user changes focus between title and content in HTML mode
    mSourceViewTitle.setOnFocusChangeListener(
        new View.OnFocusChangeListener() {
          @Override
          public void onFocusChange(View v, boolean hasFocus) {
            updateFormatBarEnabledState(!hasFocus);
          }
        });

    mSourceViewTitle.setOnTouchListener(this);
    mSourceViewContent.setOnTouchListener(this);

    mSourceViewTitle.setOnImeBackListener(this);
    mSourceViewContent.setOnImeBackListener(this);

    mSourceViewContent.addTextChangedListener(new HtmlStyleTextWatcher());

    mSourceViewTitle.setHint(mTitlePlaceholder);
    mSourceViewContent.setHint("<p>" + mContentPlaceholder + "</p>");

    // -- Format bar configuration

    setupFormatBarButtonMap(view);

    return view;
  }
 @Override
 public Loader<CharSequence> onCreateLoader(int loader, Bundle args) {
   final CharSequence raw = args.getCharSequence(ARG_TEXT);
   final Repo repo = args.getParcelable(ARG_REPO);
   return new MarkdownLoader(getActivity(), repo, raw.toString(), imageGetter, true);
 }
 public void putCurrentState(Bundle inState) {
   CharSequence label_number_sequence = inState.getCharSequence("label_number");
   label_number.setText(label_number_sequence);
 }