android.content.Intent.getFloatArrayExtra()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中android.content.Intent.getFloatArrayExtra()方法的一些代码示例,展示了Intent.getFloatArrayExtra()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Intent.getFloatArrayExtra()方法的具体详情如下:
包路径:android.content.Intent
类名称:Intent
方法名:getFloatArrayExtra

Intent.getFloatArrayExtra介绍

暂无

代码示例

代码示例来源:origin: JackWHLiu/jackknife

public static float[] getFloatArrayExtra(Intent intent, String name) {
  if (intent != null || !hasExtra(intent, name)) return null;
  return intent.getFloatArrayExtra(name);
}

代码示例来源:origin: stackoverflow.com

/**
 *  in your Activity
 */
public void startVoice(View view) {

  Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
  intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,  RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
  intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Go on, say something...");
  intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 100);

  startActivityForResult(intent, 111);
}

protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
  if (requestCode == 111) {
    if (resultCode == RESULT_OK)
    {
      ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
      float [] scores = data.getFloatArrayExtra(RecognizerIntent.EXTRA_CONFIDENCE_SCORES);
      //  TODO:  loop through possible matches, 
      //         and choose what you think is appropriate 
    }
  }
}

代码示例来源:origin: xiaolongonly/Ticket-Analysis

public static float[] getFloatArrayExtra(Intent intent, String name) {
  if (!hasIntent(intent) || !hasExtra(intent, name)) return null;
  return intent.getFloatArrayExtra(name);
}

代码示例来源:origin: retomeier/Wrox-ProfessionalAndroid-4E

protected void onActivityResult(int requestCode,
                int resultCode, Intent data) {
 if (requestCode == TTS_DATA_CHECK) {
  if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
   tts = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
    public void onInit(int status) {
     if (status == TextToSpeech.SUCCESS) {
      ttsIsInit = true;
      if (tts.isLanguageAvailable(Locale.UK) >= 0)
       tts.setLanguage(Locale.UK);
      tts.setPitch(0.8f);
      tts.setSpeechRate(1.1f);
      speak();
     }
    }
   });
  } else {
   Intent installVoice = new Intent(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
   startActivity(installVoice);
  }
 }
 // Listing 14-3: Finding the results of a speech recognition request
 if (requestCode == VOICE_RECOGNITION && resultCode == RESULT_OK) {
  ArrayList<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
  float[] confidence = data.getFloatArrayExtra(RecognizerIntent.EXTRA_CONFIDENCE_SCORES);
  // TODO Do something with the recognized voice strings
 }
}

代码示例来源:origin: TellH/AutoGo

return checkNull(intent.getByteArrayExtra(key), defValue);
} else if ("float[]".equals(type)) {
  return checkNull(intent.getFloatArrayExtra(key), defValue);
} else if ("String[]".equals(type)) {
  return checkNull(intent.getStringArrayExtra(key), defValue);

代码示例来源:origin: materialos/android-icon-pack

getWindow().setSharedElementsUseOverlay(true);
final float[] buttonLocation = getIntent().getFloatArrayExtra(EXTRA_REVEAL_ANIM_LOCATION);
final float x = buttonLocation[0];
final float y = buttonLocation[1];

相关文章

Intent类方法