私は、ベースアダプタのおかげで表示したいデバイスのリストを持っているAndroidプロジェクトに取り組んでいます。各デバイスにはシークバーで変更したいライトレベルがあります。私はデバイスを識別しようとした は、このようなタグでシークバー:送信データのタグが正しく動作していない
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:max="100"
android:tag="@{Integer.toString(ampoule.idx)}" />
をこれは私のアンプルオブジェクトである:とき私は今
<data>
<variable
name="ampoule"
type="com.example.****.***.containers.LightDevice"
/>
</data>
:
private String Type ;
private int LevelInt;
private String hueColor;
private String Name;
private int idx;
とバインディングObjectを取得するためにbaseadapterのタグを取得しようとすると、次のエラーが発生します。
FATAL EXCEPTION: main
Process: com.example.***.***, PID: 9057
java.lang.NumberFormatException: Invalid int: "binding_4"
そして、ここで私は、タグを取得する場所です:
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
setDimmableLevel(seekBar.getTag().toString(),progress);
}
private void setDimmableLevel(String idx, final int progress) {
Map<String, String> queryParams = new HashMap<>();
Log.d("TAG", "valeur idx : "+idx);
final LightDevice light = LightList.getInstance().getLight(Integer.parseInt(idx));
エラーが私のタグ値ではなくampoule.idx値をbeeingてのbinding_4されていることである...
私が何をすべきの任意のアイデア行う?
iは、その型鋳造関連の問題を考えて、その作品のことを願って、あなたは
いいえ、まだ動作していません... –