Issue
I have used a constant
private int SOME_GEN_ID = 1;
startActivityForResult(intent , SOME_GEN_ID);
instead of using a integer defined in /res/values/integers.xml as an argument to startActivtyForResult()
startActivityForResult(intent , R.integer.some_gen_id);
By using a constant, it has resolved the error:
"Can only use lower 16 bits for requestCode"
However, I was wondering if this issue has been resolved, or are all integer resources resolved to large integers when using a FragmentActivty
?
Original Issue reported HERE
Solution
R.integer.some_gen_id
is not the value of an integer resource. It is an ID of an integer resource. IDs are 32-bit values. If you want the value of an integer resource, use getResources().getInteger(R.integer.some_gen_id)
.
Answered By - CommonsWare
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.