-
Content Count
30 -
Joined
-
Last visited
Community Reputation
8 NeutralRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
have you tried using the "onMouseUp" event?
-
I tried it on a Samsung A13 and all the keys respond the same way, without any apparent delay (D12)
-
Try it this way procedure TFormMain.FormCreate(Sender: TObject); begin Image1.Parent := DrawGrid1; Image1.Left := 0; end;
-
Try var LCursor : JCursor := TAndroidHelper.Context.getContentResolver().query(URIfileTrn,nil,nil,nil,nil); If LCursor=Nil Then Exit; LCursor.moveToFirst; var colIndex : Integer := LCursor.getColumnIndexOrThrow(TJOpenableColumns.JavaClass.DISPLAY_NAME); If colIndex<>-1 Then Result := JStringToString(LCursor.getString(colIndex)); Except Result := ''; End; with the latest OS, with the path you get you can't do anything with it, personally I download the file in the personal folder and use it
-
You probably have set the "Style" preview to "Windows", try selecting the right destination (you can find it in Design)
-
if you change the value to "PrinterIndex" it is called "EndDoc", so you have to select the printer before "BeginDoc"
-
I also encountered the same problem, I solved it by replacing the code: Ad := '"' + DosyaAdi(Uri) + '" ' with If RequestCode<>Dizin_Agaci_Ac Then Ad := '"' + DosyaAdi(Uri) + '" ' Else Ad := TPath.GetFileName(JStringToString(uri.getPath)); in the "OnActivityResult" procedure, but it still doesn't work, even if you give consent you can't read the files. I tried with the "Download" folder and I only get the folders contained therein.
-
The problem is that if the division results in "NAN", no exception is raised, so at runtime the error cannot be detected.
-
Have you tested it? because it works for me, it won't be the best of programming, but if it works...
-
I had a similar problem with android, I solved it by trying to convert the result to string and then to number, so I modified your code a bit, but I can't test it with "NAN": procedure TForm2.Button1Click(Sender: TObject); var V1, V2, V3: Variant; I1, I2: Integer; S1 : String; begin V1 := 0; V2 := 0; Try V3 := V1 / V2; Except V3 := -1; End; Try S1 := FloatToStr(V3); StrToFloat(S1); Except V3 := -1; End; If V3=-1 Then ShowMessage('Division by zero') Else ShowMessage(V3); I1 := 0; I2 := 0; ShowMessage(FloatToStr(I1 / I2)); end;
-
Have you tried changing the "Scale" property? in some cases it may be fine
- 13 replies
-
- fmx
- firemonkey
-
(and 5 more)
Tagged with:
-
If your intention is to open the explorer automatically in a specific location, I don't think it's possible to do it with the system one. Third-party ones do it instead, but I've never faced the problem. This session could be a good start to understand if there is a possibility to do it.
-
I use this: uses Androidapi.JNI.GraphicsContentViewText, Androidapi.Helpers, System.Messaging, Androidapi.JNI.Net, Androidapi.JNI.App, PROCEDURE TForm1.GetFileBrowser; VAR Intent : JIntent; ReqCode : Integer; BEGIN ReqCode := 1000; Intent := TJIntent.Create; Intent.setType(StringToJString('*/*')); Intent.setAction(TJIntent.JavaClass.ACTION_GET_CONTENT); Intent.putExtra(TJIntent.JavaClass.EXTRA_ALLOW_MULTIPLE,true); TMessageManager.DefaultManager.SubscribeToMessage(TMessageResultNotification, procedure(const Sender : TObject; const aMessage : TMessage) VAR msgRES : TMessageResultNotification; begin msgRES:= TMessageResultNotification(aMessage); If msgRES.RequestCode=ReqCode Then if (msgRES.ResultCode=TJActivity.JavaClass.RESULT_OK) Then Begin URIfileTrn := msgRES.Value.getData(); //URI sing file selez If URIfileTrn=Nil Then //multiselez ClipDataF := msgRES.Value.getClipData; End; end); TAndroidHelper.Activity.startActivityForResult(Intent, ReqCode); END; and then via thread process the URI
-
Using inline variables inside loops
Minox replied to havrlisan's topic in RTL and Delphi Object Pascal
you're declaring the same variable 10 times, I don't think it's possible the way you mean, you could alternatively use a record type, and then call it in an array, like: type myRec = Record myVar : String[20]; End; [...] var ArrRec : Array Of myRec; [...] procedure Sample(const AFixedArray: TSomeFixedArray); begin SetLength(ArrRec,10); for var I = 0 to 10 do begin ArrRec[I].myVar := 'xyz'+I.ToString; // do something end end -
If you have the rights to access the "DCIM/MyFolder" folder, you could build a simple browser (via "System.IOUtils.TDirectory.GetFiles") yourself and display the files contained in a list. Or launch an "Intent" with "ACTION_GET_CONTENT", to open the system app