Example usage for android.support.v4.app ListFragment getListAdapter

List of usage examples for android.support.v4.app ListFragment getListAdapter

Introduction

In this page you can find the example usage for android.support.v4.app ListFragment getListAdapter.

Prototype

public ListAdapter getListAdapter() 

Source Link

Document

Get the ListAdapter associated with this activity's ListView.

Usage

From source file:org.kaaproject.kaa.demo.notification.activity.MainActivity.java

private void initNotificationListener() {
    notificationListener = new NotificationListener() {
        public void onNotification(final long topicId, final Notification notification) {
            Log.i(NotificationConstants.TAG, "Notification received: " + notification.toString());

            TopicHelper.addNotification(TopicStorage.get().getTopicMap(), topicId, notification);
            TopicStorage.get().save(MainActivity.this);

            ListFragment fragment = (ListFragment) getSupportFragmentManager()
                    .findFragmentByTag(NotificationConstants.NOTIFICATION_FRAGMENT_TAG);
            if (fragment != null && fragment.isVisible()) {
                updateAdapter((ArrayAdapter) fragment.getListAdapter());
                return;
            }/*www  .java2 s .c o m*/

            fragment = (ListFragment) getSupportFragmentManager()
                    .findFragmentByTag(NotificationConstants.TOPIC_FRAGMENT_TAG);
            if (fragment != null && fragment.isVisible()) {
                showNotificationDialog(topicId, notification);
                updateAdapter((ArrayAdapter) fragment.getListAdapter());
            }
        }
    };
}