Convert String containing an ID into an Integer-ID

后端 未结 6 1576
别那么骄傲
别那么骄傲 2020-12-10 03:57

I have a short question:

How is it possible to convert a String, containing the Id of a Drawable, which is

String idString = \"R.drawable.bubblegum\"         


        
6条回答
  •  星月不相逢
    2020-12-10 04:37

    At least, I couldn't get a solution for this problem. It seems that there's no way to convert a String "R.id.mytext" into an integer like R.id.mytext that can be used in findViewById(R.id.myText).

提交回复
热议问题