我得到關於按鈕android的名稱定義字符串的問題?定義按鈕android名稱的字符串?
//Initial name button
Button btn_favorite = (Button) findViewById(R.id.btn_favorite);
//condition
String Count_Favorite = "Count favorite";
//replace string for define name btn_favorite
String name_btn = Count_Favorite .replace("Count ", "btn_");
//(this, name_btn) this part i get problem
BadgeView badge = new BadgeView(this, name_btn);
badge.setText("0");
badge.setBadgePosition(BadgeView.POSITION_TOP_RIGHT);
badge.show();
大膽的是我的問題>>
BadgeView badge = new BadgeView(this, **name_btn**);
在我的代碼
name_btn
是字符串格式,我會定義爲這個按鈕的名字btn_favorite,而是錯誤。
那麼如何定義字符串name_btn的按鈕btn_favorite?
編碼錯誤的這個形象,我的FPGA實現:
BadgeView是這樣
檢查這個>>https://github.com/jgilfelt/android-viewbadger
非常不清楚!請詳細說明.. – CRUSADER
這個不是我的代碼不清楚,請告訴我... – bukanamay
你到底想幹什麼?什麼是'納瑪'? –