custList.Add(addSearchView("Poste recherché",svPoste , installation.indexPoste ,"svPoste"), 90dip, "")
Sub addSearchView(Text As String, oSearch As SearchView, oIndex As Object, nomEvent As String) As Panel
Dim p As Panel
p.Initialize("")
p.Color = Colors.white
Dim lbl As Label
lbl.Initialize("")
lbl.Text = " " & Text
lbl.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.LEFT)
lbl.TextColor = Colors.ARGB(255, 70,90,117)
lbl.TextSize = 18
lbl.Typeface = Typeface.DEFAULT_BOLD
'Add editText
oSearch.Initialize(Me, nomEvent)
oSearch.SetItems(oIndex)
p.AddView(lbl, 0dip, 2dip, custList.AsView.Width, 46dip)
'p.AddView(oSearch, 10dip, 30dip, (custList.AsView.Width -20dip), 46dip)
oSearch.AddToParent(p, 10dip, 30dip,(custList.AsView.Width -20dip), 46dip)
Return p
End Sub
if i do :
oSearch.AddToParent(p, 10dip, 30dip,(custList.AsView.Width -20dip), 46dip)
or
oSearch.AddToParent(Activity, 10dip, 30dip,(custList.AsView.Width -20dip), 46dip)
Same error i have
LogCat connected to: B4A-Bridge: samsung SM-G925F-352564074677609
--------- beginning of main
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
Installing file.
** Activity (main) Pause, UserClosed = false **
PackageAdded: package:com.fitnjob.prosg
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
(Intent) Intent { cmp=com.fitnjob.prosg/.httputils2service }
** Activity (main) Pause, UserClosed = false **
** Activity (modcandidat) Create, isFirst = true **
~w:1004,modcandidat,72
** Activity (modcandidat) Resume **
** Activity (modcandidat) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (modcandidat) Resume **
~w:1001,modcandidat,344
searchview_et_textchanged (B4A line: 48)
lv.Clear
java.lang.RuntimeException: Object should first be initialized (ListView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.ListViewWrapper.Clear(ListViewWrapper.java:197)
at com.fitnjob.prosg.searchview._et_textchanged(searchview.java:166)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.objects.EditTextWrapper$1.afterTextChanged(EditTextWrapper.java:83)
at android.widget.TextView.sendAfterTextChanged(TextView.java:9017)
at android.widget.TextView.setText(TextView.java:4859)
at android.widget.TextView.setText(TextView.java:4674)
at android.widget.EditText.setText(EditText.java:114)
at android.widget.TextView.setText(TextView.java:4649)
at android.widget.TextView.setTransformationMethod(TextView.java:2284)
at android.widget.TextView.applySingleLine(TextView.java:8636)
at android.widget.TextView.setInputType(TextView.java:5091)
at anywheresoftware.b4a.objects.EditTextWrapper.setInputType(EditTextWrapper.java:174)
at com.fitnjob.prosg.searchview._initialize(searchview.java:224)
at com.fitnjob.prosg.modcandidat._addsearchview(modcandidat.java:785)
at com.fitnjob.prosg.modcandidat._actionbar1_click(modcandidat.java:443)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:882)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:839)
at com.fitnjob.prosg.ahaactionbar._lsvnavigationdrawer_itemclick(ahaactionbar.java:2264)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.BA$2.run(BA.java:299)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6837)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)