Android | Kotlin | NULL SAFETY
Kotlin | NULL SAFETY Elvis Operator: ?: x ?: y ---- evaluates x, If x!=null, Then the result of the expression = x Else Result of expression = y // (which ought to be of a non-nullable type) We can also use this operator to perform an early return in case of null: Example : val z = x ?: return y Explanation: If x!=null Assign x to z Else the entire function that contains this expression will stop and return y. (this works because return is also an expression, and if it is evaluated, it evaluates its argument and then makes the containing function return the result...
Hi,
ReplyDeletethanks for this code, I'm converting it to C# (Xamarin).
I'm just wondering, in this line of code:
cursor.getColumnIndexOrThrow(column);
What is the column value? I don't see it set it anywhere and I don't have any example of a file that will go through this code so that I could debug it.
Thanks again.
Hi Luis,
DeleteSorry for the late response.
column is a String variable with value -> "_data"
i.e final String column = "_data";
I have updated the post as well.
Cheers
Thanks for the information :)
Deletecursor.getColumnIndexOrThrow(column);
ReplyDeleteWhat is column value??
Hi Navneet,
DeleteSorry for the late response.
column is a String variable with value -> "_data"
i.e final String column = "_data";
I have updated the post as well.
Let me know is you need any further details.
Cheers
thanks. a customer ask I should build him page eiyh his own picked image on it. that viewer can view soccer football tennis, hocky, ice ball. e.t.c. live score I build him one, he said he did not like it. please post code, I will like to learn.
ReplyDeleteHi User,
DeleteThanks for your time to write here.
I am not able to understand whats your requirement. Kindly provide some further information. You can also write me at tech.rajat.singh@gmail.com.
Super, works fine.
ReplyDeletecheers :)
DeleteGot an error
ReplyDeletejava.lang.IllegalArgumentException: column '_data' does not exist. Available columns: []
at
final int index = cursor.getColumnIndexOrThrow(column);
i am using android 9, while trying to share an image from another app (sharechat)
Hi Binu,
DeleteHope you are doing great!
On which device are you testing? Please share more details about device you are using. Also, share the steps to reproduce it.
Thanks