Udit003
08/17/2018, 11:49 AMibraiz_teamo
08/18/2018, 11:22 AMJakub
08/18/2018, 5:06 PMLucas Ł
08/18/2018, 5:36 PMTimber
a tryAyden
08/18/2018, 5:48 PMtwisterrob
08/18/2018, 10:24 PMJakub
08/19/2018, 7:17 PMTony Hoyle
08/19/2018, 7:28 PMDaniele Segato
08/20/2018, 8:10 AMUnresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public fun `Activity;`.findNavController(viewId: Int): `NavController;` defined in androidx.navigation
public fun `View;`.findNavController(): `NavController;` defined in androidx.navigation
This means my previously working code doesn't compile anymore on this stuff:
view.setOnClickListener {
it.findNavController().navigate(somewhere)
}
cause it cant resolve findNavController()
extension function.
I think it's a collision?
Checked the source code
package androidx.navigation
import android.view.View
/**
* Find a [NavController] associated with a [View].
*
* Calling this on a View not within a [NavHost] will result in an
* [IllegalStateException]
*/
fun View.findNavController(): NavController =
Navigation.findNavController(this)
and
package androidx.navigation
import android.app.Activity
import android.support.annotation.IdRes
/**
* Find a [NavController] given the id of a View and its containing
* [Activity].
*
* Calling this on a View that is not a [NavHost] or within a [NavHost]
* will result in an [IllegalStateException]
*/
fun Activity.findNavController(@IdRes viewId: Int): NavController =
Navigation.findNavController(this, viewId)
these two collide I think and when you import androidx.navigation.findNavController
it doesn't know which one to import?josefrichter
08/20/2018, 1:56 PMgildor
08/21/2018, 8:03 AMigor.wojda
08/21/2018, 1:23 PMhallvard
08/21/2018, 1:52 PMursus
08/21/2018, 3:58 PMSlackbot
08/21/2018, 6:27 PMpankaj
08/21/2018, 7:27 PMPaul Woitaschek
08/22/2018, 9:25 PMPaul Woitaschek
08/22/2018, 9:54 PMKevin Janvier Chinabalire
08/23/2018, 7:16 AMKevin Janvier Chinabalire
08/23/2018, 7:30 AMjava.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
It run for the first time then crash for second time
fun clearAndResetAllTables(): Boolean {
if (db== null) return false
// reset all auto-incrementalValues
val query = SimpleSQLiteQuery("DELETE FROM sqlite_sequence")
db!!.beginTransaction()
return try {
db!!.clearAllTables()
db!!.query(query)
db!!.setTransactionSuccessful()
true
} catch (e: Exception){
false
} finally {
db!!.endTransaction()
}
}
Ayokunle Paul
08/23/2018, 9:18 AMDenis A
08/23/2018, 3:29 PMParshav
08/23/2018, 5:35 PMneuber
08/23/2018, 11:41 PMSlackbot
08/24/2018, 5:16 AMleosan
08/24/2018, 10:50 AMprivate val imageResource: Int? by lazy { arguments?.getInt(ARG) }
//Doesn't work compiler complain it is not integer
imageResource?.let { ivIcon.setImageResource(it) }
//Works
imageResource?.run { ivIcon.setImageResource(this) }
is there a way to use the `@DrawableRes`with delegates? or do I have to lose the perk of using setImageResource
?
Edit: It works with run
what am I missing here?Viktor Vostrikov
08/25/2018, 2:43 PMwck
08/27/2018, 5:45 AMMockito.any(T::class.java)
return null in Kotlin?zone
08/27/2018, 7:19 AMg4sarma
08/27/2018, 10:45 AMg4sarma
08/27/2018, 10:45 AMlouiscad
08/27/2018, 10:47 AMg4sarma
08/27/2018, 10:49 AMlouiscad
08/27/2018, 10:50 AMcode formatting
with backticks