The key must be an application-specific resource id

后端 未结 10 1453
时光说笑
时光说笑 2020-11-29 18:11

Why do I get this Exception?

05-18 20:29:38.044: ERROR/AndroidRuntime(5453): java.lang.IllegalArgumentException: The key must be an application-specific reso         


        
10条回答
  •  日久生厌
    2020-11-29 18:24

    The reason you're not able to use setTag(int, Object) is because android require a pre-compiled unique id in the 'int' argument.

    Try creating two unique entry in String.xml xml say, "firstname" & "secondname" & use them as below

    imageView.setTag(R.string.firstname, "Abhishek");
    imageView.setTag(R.string.lastname, "Gondalia");
    

提交回复
热议问题