开发者

Android ListAdapter in Activity?

开发者 https://www.devze.com 2023-04-06 00:06 出处:网络
Is this possible to use the ListAdapter extends activity class? If yes means let me know please. Ot开发者_高级运维herwise, What is the alternate Way?It is technically possible to make a class that ext

Is this possible to use the ListAdapter extends activity class? If yes means let me know please. Ot开发者_高级运维herwise, What is the alternate Way?


It is technically possible to make a class that extends Activity and implements the ListAdapter interface, but there is no reason to do this. Instead, you would instantiate an implementation of the ListAdapter inside your Activity. ListAdapter would provide data for a list, whereas an Activity is essentially a "page" in your application.

Instead, you could use the already existing ListActivity to make an activity that displays a list powered by a ListAdapter. See "Binding to Data" in http://developer.android.com/reference/android/app/ListActivity.html.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号