忍者ブログ

とある社内SEの備忘録 !!

主にRPA、Androidアプリ開発について投稿しています。メモ書きです。

ExpandableListViewのAdapterの取得

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

ExpandableListViewのAdapterの取得


ExpandableListViewで、getAdapterしてキャストするとClassCastExceptionが発生。
ExpandableListView.OnGroupClickListener OnGroupClickInput = new ExpandableListView.OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
System.out.println(parent.getAdapter().getClass().getSimpleName());
System.out.println(parent.getExpandableListAdapter().getClass().getSimpleName());

コンソールに表示させてみると、確かに違う。
I/System.out: ExpandableListConnector
ExpandableTkmtAdapter
getExpandableListAdapter()とする必要がある。
PR

コメント

プロフィール

HN:
Satoshin
性別:
男性
職業:
開拓エンジニア
趣味:
ダーツ、麻雀、カラオケ、ジョギング
自己紹介:
横浜在住の30代♂

某企業の情報システム部門に所属。
⇒転職活動中

業務効率化を推進しつつ自社用Androidアプリを開発している。
言語:Java、VB.NET、VBA、ASP.NET、C#
興味:Kotlin、Python、AWS、UiPath

横浜圏の友人皆無・・(´;ω;`)
RPA、ダーツ、麻雀、飲み仲間募集中w

麻雀格闘倶楽部はココに出没中

AbemaTVでM.LEAGUE鑑賞中!!

P R