当前位置: 首页>>代码示例>>Java>>正文


Java ListFragment.setListAdapter方法代码示例

本文整理汇总了Java中android.app.ListFragment.setListAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java ListFragment.setListAdapter方法的具体用法?Java ListFragment.setListAdapter怎么用?Java ListFragment.setListAdapter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.ListFragment的用法示例。


在下文中一共展示了ListFragment.setListAdapter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onFragmentViewCreated

import android.app.ListFragment; //导入方法依赖的package包/类
@Override
public void onFragmentViewCreated(ListFragment fragment) {
    fragment.getListView().addHeaderView(
            getLayoutInflater().inflate(R.layout.reserve_action_bar_space_header_view, null));
    int dayIndex = fragment.getArguments().getInt(ARG_CONFERENCE_DAY_INDEX, 0);
    if (dayIndex < 0) {
        fragment.setListAdapter(mDayZeroAdapter);
        fragment.getListView().setRecyclerListener(mDayZeroAdapter);
    } else {
        fragment.setListAdapter(mScheduleAdapters[dayIndex]);
        fragment.getListView().setRecyclerListener(mScheduleAdapters[dayIndex]);
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:14,代码来源:MyScheduleActivity.java

示例2: onFragmentViewCreated

import android.app.ListFragment; //导入方法依赖的package包/类
@Override
public void onFragmentViewCreated(ListFragment fragment) {
    fragment.getListView().addHeaderView(
            getLayoutInflater().inflate(com.saarang.samples.apps.iosched.R.layout.reserve_action_bar_space_header_view, null));
    int dayIndex = fragment.getArguments().getInt(ARG_CONFERENCE_DAY_INDEX, 0);
    fragment.setListAdapter(mScheduleAdapters[dayIndex]);
    fragment.getListView().setRecyclerListener(mScheduleAdapters[dayIndex]);
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:9,代码来源:MyScheduleActivity.java

示例3: onFragmentViewCreated

import android.app.ListFragment; //导入方法依赖的package包/类
@Override
public void onFragmentViewCreated(ListFragment fragment) {
    fragment.getListView().addHeaderView(
            getLayoutInflater().inflate(R.layout.reserve_action_bar_space_header_view, null));
    int dayIndex = fragment.getArguments().getInt(ARG_CONFERENCE_DAY_INDEX, 0);
    fragment.setListAdapter(mScheduleAdapters[dayIndex]);
    fragment.getListView().setRecyclerListener(mScheduleAdapters[dayIndex]);
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:9,代码来源:MyScheduleActivity.java

示例4: onCreate

import android.app.ListFragment; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_rest_service);
    
    mAdapter = new ArrayAdapter<String>(this, R.layout.item_label_list);
    
    FragmentManager     fm = getFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    
    ListFragment list = new ListFragment();
    ft.add(R.id.fragment_content, list);
    
    // Let's set our list adapter to a simple ArrayAdapter.
    list.setListAdapter(mAdapter);
    
    // RESTResponderFragments call setRetainedInstance(true) in their onCreate() method. So that means
    // we need to check if our FragmentManager is already storing an instance of the responder.
    TwitterSearchResponderFragment responder = 
            (TwitterSearchResponderFragment) fm.findFragmentByTag("RESTResponder");
    if (responder == null) {
        responder = new TwitterSearchResponderFragment();
        
        // We add the fragment using a Tag since it has no views. It will make the Twitter REST call
        // for us each time this Activity is created.
        ft.add(responder, "RESTResponder");
    }

    // Make sure you commit the FragmentTransaction or your fragments
    // won't get added to your FragmentManager. Forgetting to call ft.commit()
    // is a really common mistake when starting out with Fragments.
    ft.commit();
}
 
开发者ID:mobilepaas,项目名称:gasp-android,代码行数:34,代码来源:TwitterRESTServiceActivity.java

示例5: onCreate

import android.app.ListFragment; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_rest_service);
    
    mAdapter = new ArrayAdapter<String>(this, R.layout.item_label_list);
    
    FragmentManager     fm = getFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    
    ListFragment list = new ListFragment();
    ft.add(R.id.fragment_content, list);
    
    list.setListAdapter(mAdapter);
    
    // RESTResponderFragments call setRetainedInstance(true) in their onCreate() method. So that means
    // we need to check if our FragmentManager is already storing an instance of the responder.
    GaspReviewsResponderFragment responder = 
            (GaspReviewsResponderFragment) fm.findFragmentByTag("RESTResponder");
    if (responder == null) {
        responder = new GaspReviewsResponderFragment();
        
        // We add the fragment using a Tag since it has no views. It will make the Twitter REST call
        // for us each time this Activity is created.
        ft.add(responder, "RESTResponder");
    }

    ft.commit();
}
 
开发者ID:mobilepaas,项目名称:gasp-android,代码行数:30,代码来源:GaspRESTServiceActivity.java


注:本文中的android.app.ListFragment.setListAdapter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。