Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29612

How to set android:icon dynamically

$
0
0

I'm using react-native-config to be able to build using different environments. One of the purposes is to have different icons depending on the environment. I got this to work on iOS but having trouble on Android.

I have a @string resource:<string name="exchange_name">@string/REACT_APP_EXCHANGE_NAME</string>

The REACT_APP_EXCHANGE_NAME variable is inserted from my .env file (react-native-config magic).My question is how can I have different icons depending on the value of that string resource?

Something like:android:icon={exchange_name == 'something' ? @mipmap/icon1 : @mipmap/icon2}


Viewing all articles
Browse latest Browse all 29612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>