Last active
September 28, 2015 15:12
-
-
Save sockeqwe/4521a049f7fe64c4fc7d to your computer and use it in GitHub Desktop.
FragmentArgs with Kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kapt { | |
generateStubs = true | |
} | |
dependencies { | |
compile 'com.hannesdorfmann.fragmentargs:annotation:2.1.2' | |
kapt 'com.hannesdorfmann.fragmentargs:processor:2.1.2' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v4.app.Fragment | |
import com.hannesdorfmann.fragmentargs.annotation.Arg | |
public class TestFragment : Fragment() { | |
@Arg lateinit val foo: String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should change that from val to var. See http://blog.jetbrains.com/kotlin/2015/09/call-for-feedback-java-statics-result-expressions-and-more/