I need to create a JEditText, so i found theses methods :
JEditTextClass = interface(JTextViewClass)
['{A1E1255C-8FC9-449A-A886-57ABA315C3E3}']
{class} function init(context: JContext): JEditText; cdecl; overload;
{class} function init(context: JContext; attrs: JAttributeSet): JEditText; cdecl; overload;
{class} function init(context: JContext; attrs: JAttributeSet; defStyleAttr: Integer): JEditText; cdecl; overload;
{class} function init(context: JContext; attrs: JAttributeSet; defStyleAttr: Integer; defStyleRes: Integer): JEditText; cdecl; overload;
end;
but i can't understand how to set (and with what?)
attrs: JAttributeSet;
defStyleAttr: Integer;
defStyleRes: Integer
I'd suggest the more flexible constructors are there for those who need them. If you don't know what to pass to them, perhaps you don't need them.
The DPF code that wraps up an Android EditText
uses the simplest constructor - see TDPFJEditText.Create
in DPF.Android.JEditText.pas.
Additionally, looking at the Android documentation for AttributeSet
, it would appear these tend to get created to represent attributes found in the XML definitions of Android resources, something we have no typical use of in Delphi Android apps.
I would suggest you use the simple constructor to create your object and then employ the various properties and methods of the created EditText
. Don't get bogged down in the intricacies of the underpinnings of the resources that typically go to make up a Java Android app.