Sunday, 15 June 2014

android - Application crashing only in 4.4.2 when using setShadowLayer() -



android - Application crashing only in 4.4.2 when using setShadowLayer() -

i using textview.setshadowlayer(60,0,0, 0xff303030); within custom adapter of list view. application running in other phones @ 4.4.2 version.

at first unable find real cause of problem. noticed whenever commenting above line, application running fine in 4.4.2.

please help me find solution utilize above code in versions or suggest alternative above code.

pedrohawk's comment helped me find solution issue.

this how solved issue:

textview.setlayertype(view.layer_type_software, null); textview.setshadowlayer(60,0,0, 0xff303030);

while adding above code directly, caused crashing in 2.3 devices. had this:

if(build.version.sdk_int >= build.version_codes.kitkat) { textview.setlayertype(view.layer_type_software, null); } textview.setshadowlayer(5,0,0, 0xff303030);

the above code made work in versions (i have tested 2.3.3, 4.0.4, 4.4.2).

android

No comments:

Post a Comment