Anko: Problem with Intent and missing anko's startActivityForResult

Created on 9 Apr 2015  路  3Comments  路  Source: Kotlin/anko

I found 2 problems with the Intent function:

  1. It collides with android.content.Intent, making it difficult to use if I'm in an activity that overrides functions like onActivityResult or onNewIntent. Since Activity already has a property intent, I propose to rename the function to intentFor or newIntent.
  2. When I use it, I get an error: "Type argument is not within its bound. Expected: java.lang.class<_>. Found: com.my.MyActivity". When I ctrl+click on it, I get the signature of the function with the type parameter being reified T : java.lang.Class<_>. I guess it should only bereified T : Any.

Also, Anko provides a utility function startActivity but not startActivityForResult.

Finally, startActivity is defined for Activity and android.app.Fragment but not for android.support.v4.app.Fragment

bug fixed

Most helpful comment

The last part of the question is not solved

Finally, startActivity is defined for Activity and android.app.Fragment but not for android.support.v4.app.Fragment

All 3 comments

Fixed.

The last part of the question is not solved

Finally, startActivity is defined for Activity and android.app.Fragment but not for android.support.v4.app.Fragment

Contributions are welcome!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SUPERCILEX picture SUPERCILEX  路  4Comments

lupajz picture lupajz  路  3Comments

HarryTylenol picture HarryTylenol  路  4Comments

vlonjatg picture vlonjatg  路  3Comments

HarryTylenol picture HarryTylenol  路  3Comments