如何从一个适配器完成一项活动..?
问题描述:
我试图与传递活动上下文
插入适配器,然后我试图 context.finish();
但是,它给我一个错误,如的方法完成()是未定义的类型上下文
I tried with passing context
of activity into the adapter and then i tried context.finish();
But its giving me one error like The method finish() is undefined for the type Context
答
类型强制转换。
((Activity)context).finish();