Category : data-class

so, I heard there are no ternary operators in kotlin, so, how can I achieve the following in kotlin data class JS {online.map(function(item){ return ( <div key={item.uid} > {item.Gender== ‘Male’ ? <li > <div><img src={item.photoURL}/><p><b>{item.displayName}</b></p></div> </li> : null} </div> ) })} online is an object that contains the list of user information {item.Gender === ‘Male’ ..

Read more

Error message Found data binding error(s): [databinding] {"msg":"Could not find accessor com.dubhe.room.entity.User.name","file":"appsrcmainreslayoutactivity_add_user.xml","pos":[{"line0":31,"col0":28,"line1":31,"col1":36}]} My layout XML <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <data> <import alias="user" type="com.dubhe.room.entity.User" /> <variable name="add" type="android.view.View.OnClickListener" /> </data> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <androidx.appcompat.widget.Toolbar android:layout_width="match_parent" android:layout_height="wrap_content" app:title="addUser" /> <EditText android:id="@+id/editUserName" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="name" android:text="@{user.name}" /> <-error in this line. <EditText android:id="@+id/editUserAge" android:layout_width="match_parent" android:layout_height="wrap_content" ..

Read more