title: How to parse data from intent in Delphi
body: <p>I'm trying to get data from an <code>Intent</code>. It is passed as an array of <code>Float</code> containing one element.  I tried this code, but it crashes:</p>
  
  <pre><code>procedure TMainScreen.BroadcastReceiver2Receive(Context: JContext; Intent: JIntent);
  {$IFDEF ANDROID}
  var
    Temp: String;
    Hr1: single;
    Bundle :Jbundle;
  begin
    button2.Text:= 'triggered';
    if Intent.hasExtra(stringtojstring('DATA')) = true then
    begin
      bundle := intent.getExtras();
      button1.Text:= 'got data';
      hr1:= bundle.getFloatArray(stringtojstring('DATA'))[0];
      button2.Text:= floattostr(hr1);
    end;
  {$ELSE}
  begin
  {$ENDIF}
  end;
  </code></pre>
  
  <p>I'm sure I'm not dealing with the array correctly. How do I do it?</p>