public class MainActivity { private TextView textView; //1- @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = findViewById(R.id.textView);//2- textView.setText("Hello world!");//3- } }
public class MainActivity...{ @BindView(R.id.textView)TextView textView; //1- @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this);//2- textView.setText("Hello world!");//3- } }
class MainActivity: AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) textView.text = "Hello world!"//1- } }
data class ResponseItem(@SerializedName("id") @Expose var id: String?, @SerializedName("name") @Expose var name: String?, @SerializedName("symbol") @Expose var symbol: String?, @SerializedName("rank") @Expose var rank: String?, @SerializedName("price_usd") @Expose var priceUsd: String?, @SerializedName("price_btc") @Expose var priceBtc: String?, @SerializedName("24h_volume_usd") @Expose var _24hVolumeUsd: String?, @SerializedName("market_cap_usd") @Expose var marketCapUsd: String?, @SerializedName("available_supply") @Expose var availableSupply: String?, @SerializedName("total_supply") @Expose var totalSupply: String?, @SerializedName("max_supply") @Expose var maxSupply: String?, @SerializedName("percent_change_1h") @Expose var percentChange1h: String?, @SerializedName("percent_change_24h") @Expose var percentChange24h: String?, @SerializedName("percent_change_7d") @Expose var percentChange7d: String?, @SerializedName("last_updated") @Expose var lastUpdated: String?)
@SerializedName("id") @Expose private String id; @SerializedName("name") @Expose private String name; @SerializedName("symbol") @Expose private String symbol; @SerializedName("rank") @Expose private String rank; @SerializedName("price_usd") @Expose private String priceUsd; @SerializedName("price_btc") @Expose private String priceBtc; @SerializedName("24h_volume_usd") @Expose private String _24hVolumeUsd; @SerializedName("market_cap_usd") @Expose private String marketCapUsd; @SerializedName("available_supply") @Expose private String availableSupply; @SerializedName("total_supply") @Expose private String totalSupply; @SerializedName("max_supply") @Expose private Object maxSupply; @SerializedName("percent_change_1h") @Expose private String percentChange1h; @SerializedName("percent_change_24h") @Expose private String percentChange24h; @SerializedName("percent_change_7d") @Expose private String percentChange7d; @SerializedName("last_updated") @Expose private String lastUpdated; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSymbol() { return symbol; } public void setSymbol(String symbol) { this.symbol = symbol; } public String getRank() { return rank; } public void setRank(String rank) { this.rank = rank; } public String getPriceUsd() { return priceUsd; } public void setPriceUsd(String priceUsd) { this.priceUsd = priceUsd; } public String getPriceBtc() { return priceBtc; } public void setPriceBtc(String priceBtc) { this.priceBtc = priceBtc; } public String get24hVolumeUsd() { return _24hVolumeUsd; } public void set24hVolumeUsd(String _24hVolumeUsd) { this._24hVolumeUsd = _24hVolumeUsd; } public String getMarketCapUsd() { return marketCapUsd; } public void setMarketCapUsd(String marketCapUsd) { this.marketCapUsd = marketCapUsd; } public String getAvailableSupply() { return availableSupply; } public void setAvailableSupply(String availableSupply) { this.availableSupply = availableSupply; } public String getTotalSupply() { return totalSupply; } public void setTotalSupply(String totalSupply) { this.totalSupply = totalSupply; } public Object getMaxSupply() { return maxSupply; } public void setMaxSupply(Object maxSupply) { this.maxSupply = maxSupply; } public String getPercentChange1h() { return percentChange1h; } public void setPercentChange1h(String percentChange1h) { this.percentChange1h = percentChange1h; } public String getPercentChange24h() { return percentChange24h; } public void setPercentChange24h(String percentChange24h) { this.percentChange24h = percentChange24h; } public String getPercentChange7d() { return percentChange7d; } public void setPercentChange7d(String percentChange7d) { this.percentChange7d = percentChange7d; } public String getLastUpdated() { return lastUpdated; } public void setLastUpdated(String lastUpdated) { this.lastUpdated = lastUpdated; }
someModel.name = "new name"
Source: https://habr.com/ru/post/344540/
All Articles