Example usage for android.support.v4.util CircularArray addFirst

List of usage examples for android.support.v4.util CircularArray addFirst

Introduction

In this page you can find the example usage for android.support.v4.util CircularArray addFirst.

Prototype

public final void addFirst(E e) 

Source Link

Usage

From source file:com.appsimobile.appsii.Appsi.java

@Override
public int onStartCommand(@Nullable Intent intent, int flags, int startId) {
    Log.d(TAG, "onStartCommand() called with: " + "intent = [" + intent + "], flags = [" + flags
            + "], startId = [" + startId + "]");
    startAppsiService();//from   w  w w. ja v a  2s. c om
    // force initialize the home config to make everything a bit smoother
    // and this makes sure we don't have to wait for it when opening the
    // sidebar for the first time.
    // mHomeItemConfigurationHelper

    String action = intent == null ? null : intent.getAction();
    if (ACTION_TRY_PAGE.equals(action)) {

        HotspotPageEntry entry = intent.getParcelableExtra("entry");
        HotspotItem hotspotItem = intent.getParcelableExtra("hotspot");
        if (entry != null && hotspotItem != null) {
            CircularArray<HotspotPageEntry> entries = new CircularArray<>(1);
            entries.addFirst(entry);
            openSidebar(hotspotItem, entries, 0, true);
        }
    }

    return Service.START_STICKY;
}