Java Code Examples for android.os.Bundle.getParcelableArray()

The following are Jave code examples for showing how to use getParcelableArray() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: GitJourney   File: StackWidgetService.java   View Source Code Vote up 7 votes
public StackRemoteViewsFactory(Context applicationContext, Intent intent) {
    Log.v(TAG, "StackRemoteViewsFactory");
    intent.setExtrasClassLoader(GitHubJourneyWidgetDataEntry.class.getClassLoader());
    this.context = applicationContext;
    appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, 1);
    Bundle bundle = intent.getBundleExtra("bundle");
    Parcelable[] items = bundle.getParcelableArray("parcelables");
    Log.v(TAG, "items size = " + items.length);

    if (items.length != 0) {
        widgetDatas = new ArrayList<>(items.length);
        for (Parcelable item : items) {
            widgetDatas.add((GitHubJourneyWidgetDataEntry) item);
        }
    } else {
        widgetDatas = new ArrayList<>(0);
    }
    Log.v(TAG, "widgetDatas" + widgetDatas.size());
}
 
Example 2
Project: CameraKitView   File: AspectRatioFragment.java   View Source Code Vote up 6 votes
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Bundle args = getArguments();
    final AspectRatio[] ratios = (AspectRatio[]) args.getParcelableArray(ARG_ASPECT_RATIOS);
    if (ratios == null) {
        throw new RuntimeException("No ratios");
    }
    Arrays.sort(ratios);
    final AspectRatio current = args.getParcelable(ARG_CURRENT_ASPECT_RATIO);
    final AspectRatioAdapter adapter = new AspectRatioAdapter(ratios, current);
    return new AlertDialog.Builder(getActivity())
        .setAdapter(adapter, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int position) {
                mListener.onAspectRatioSelected(ratios[position]);
            }
        })
        .create();
}
 
Example 3
Project: PinchToZoom   File: MainActivity.java   View Source Code Vote up 6 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    List<Drawable> drawables = new ArrayList<>();
    if(savedInstanceState != null) {
        Resources resources = getResources();
        Parcelable[] parcelables = savedInstanceState.getParcelableArray(BITMAPS);
        for (int i = 0, n = parcelables.length; i < n; i++) {
            drawables.add(new BitmapDrawable(resources, (Bitmap) parcelables[i]));
        }
    } else {
        addDefaultImages(drawables);
    }
    imageViewPagerAdapter = new ImageViewPagerAdapter(drawables);

    viewPager = (ViewPager) findViewById(R.id.pager);
    viewPager.setOffscreenPageLimit(3);
    viewPager.setAdapter(imageViewPagerAdapter);
}
 
Example 4
Project: boohee_v5.6   File: d.java   View Source Code Vote up 6 votes
public d(Bundle bundle) {
    this.h = bundle.getString("ext_to");
    this.i = bundle.getString("ext_from");
    this.j = bundle.getString("ext_chid");
    this.g = bundle.getString("ext_pkt_id");
    Parcelable[] parcelableArray = bundle.getParcelableArray("ext_exts");
    if (parcelableArray != null) {
        this.l = new ArrayList(parcelableArray.length);
        for (Parcelable parcelable : parcelableArray) {
            a a = a.a((Bundle) parcelable);
            if (a != null) {
                this.l.add(a);
            }
        }
    }
    Bundle bundle2 = bundle.getBundle("ext_ERROR");
    if (bundle2 != null) {
        this.n = new h(bundle2);
    }
}
 
Example 5
Project: Android_watch_magpie   File: AlertFragment.java   View Source Code Vote up 6 votes
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (savedInstanceState == null) {
        alertAdapter = new AlertAdapter(getActivity());
    } else {
        Alert[] alerts = (Alert[]) savedInstanceState.getParcelableArray(BUNDLE_KEY);
        List<Alert> alertsList = new ArrayList<>();
        for (Alert alert : alerts) {
            alertsList.add(alert);
        }
        alertAdapter = new AlertAdapter(getActivity(), alertsList);
    }

    alertDAO = new AlertDAO(getActivity());
    alertDAO.open();
    if (alertAdapter.getCount() == 0) {
        alertAdapter.addAllItems(alertDAO.getAllAlerts());
    }
    setListAdapter(alertAdapter);

    setHasOptionsMenu(true);
}
 
Example 6
Project: Quran   File: FragmentStatePagerAdapter.java   View Source Code Vote up 5 votes
@Override
public void restoreState(Parcelable state, ClassLoader loader) {
  if (state != null) {
    Bundle bundle = (Bundle) state;
    bundle.setClassLoader(loader);
    mSavedState.clear();
    mFragments.clear();

    String lastMode = bundle.getString("mode", "");
    if (!mode.equals(lastMode)) {
      cleanupOldFragments(bundle);
      return;
    }

    Parcelable[] fss = bundle.getParcelableArray("states");
    if (fss != null) {
      for (Parcelable fs : fss) {
        mSavedState.add((Fragment.SavedState) fs);
      }
    }
    Iterable<String> keys = bundle.keySet();
    for (String key : keys) {
      if (key.startsWith("f")) {
        int index = Integer.parseInt(key.substring(1));
        Fragment f = mFragmentManager.getFragment(bundle, key);
        if (f != null) {
          while (mFragments.size() <= index) {
            mFragments.add(null);
          }
          f.setMenuVisibility(false);
          mFragments.set(index, f);
        } else {
          Timber.w("Bad fragment at key %s", key);
        }
      }
    }
  }
}
 
Example 7
Project: CircleMenu   File: CircleMenu.java   View Source Code Vote up 5 votes
@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        Bundle bundle = (Bundle) state;
        currentIndex = bundle.getInt("currentIndex");
        menuStatus = bundle.getInt("menuStatus");
        lastIndex = bundle.getInt("lastIndex");
        clickIndex = bundle.getInt("clickIndex");
        state = bundle.getParcelable("superState");
        runningPoints = (PathPoint[]) bundle.getParcelableArray("runningPoints");
        endPathPoints = (PathPoint[]) bundle.getParcelableArray("endPoints");
    }
    super.onRestoreInstanceState(state);
}
 
Example 8
Project: Hillffair17   File: ProfileTab3.java   View Source Code Vote up 5 votes
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){

    View view = inflater.inflate(R.layout.fragment_profiletab3, container, false);

    nodata = (TextView) view.findViewById(R.id.nodata);
    recyclerView = (RecyclerView) view.findViewById(R.id.news_list);
    progress = (ProgressBar) view.findViewById(R.id.progress);
    list = new ArrayList<>();

    adapter = new NewsFeedAdapter(getContext());
    recyclerView.setAdapter(adapter);

    final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
    recyclerView.setLayoutManager(linearLayoutManager);

    sharedPref = new SharedPref(getContext());

    Log.d("id",sharedPref.getUserId());
    if(savedInstanceState==null){
        getData(1,sharedPref.getUserId());
        progress.setVisibility(View.VISIBLE);
    }

    else{
        if(savedInstanceState.getParcelableArray(USER_POST)!=null){
            recyclerView.setVisibility(View.VISIBLE);
            list = savedInstanceState.getParcelableArrayList(USER_POST);
            adapter.refresh(list);
        }
        else{
            nodata.setVisibility(View.VISIBLE);
            nodata.setText("No Post Uploaded");
        }

    }


    return view;
}
 
Example 9
Project: Nimbus   File: ProfileTab3.java   View Source Code Vote up 5 votes
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){

    View view = inflater.inflate(R.layout.fragment_profiletab3, container, false);

    nodata = (TextView) view.findViewById(R.id.nodata);
    recyclerView = (RecyclerView) view.findViewById(R.id.news_list);
    progress = (ProgressBar) view.findViewById(R.id.progress);
    list = new ArrayList<>();

    adapter = new NewsFeedAdapter(getContext());
    recyclerView.setAdapter(adapter);

    final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
    recyclerView.setLayoutManager(linearLayoutManager);

    sharedPref = new SharedPref(getContext());

    Log.d("id",sharedPref.getUserId());
    if(savedInstanceState==null){
        getData(1,sharedPref.getUserId());
        progress.setVisibility(View.VISIBLE);
    }

    else{
        if(savedInstanceState.getParcelableArray(USER_POST)!=null){
            recyclerView.setVisibility(View.VISIBLE);
            list = savedInstanceState.getParcelableArrayList(USER_POST);
            adapter.refresh(list);
        }
        else{
            nodata.setVisibility(View.VISIBLE);
            nodata.setText("No Post Uploaded");
        }

    }


    return view;
}
 
Example 10
Project: letv   File: NotificationCompat.java   View Source Code Vote up 5 votes
private static Notification[] getNotificationArrayFromBundle(Bundle bundle, String key) {
    Parcelable[] array = bundle.getParcelableArray(key);
    if ((array instanceof Notification[]) || array == null) {
        return (Notification[]) array;
    }
    Notification[] typedArray = new Notification[array.length];
    for (int i = 0; i < array.length; i++) {
        typedArray[i] = (Notification) array[i];
    }
    bundle.putParcelableArray(key, typedArray);
    return typedArray;
}
 
Example 11
Project: A.scribe   File: FragmentStatePagerAdapter2.java   View Source Code Vote up 5 votes
@Override
public void restoreState(Parcelable state, ClassLoader loader) {
    if (state != null) {
        Bundle bundle = (Bundle) state;
        bundle.setClassLoader(loader);
        fragments.clear();
        if (enableSavedStates) {
            Parcelable[] fss = bundle.getParcelableArray("states");
            savedState.clear();
            if (fss != null) {
                for (Parcelable fs : fss) {
                    savedState.add((Fragment.SavedState) fs);
                }
            }
        }
        Iterable<String> keys = bundle.keySet();
        for (String key : keys) {
            if (key.startsWith("f")) {
                int index = Integer.parseInt(key.substring(1));
                Fragment f = fragmentManager.getFragment(bundle, key);
                if (f != null) {
                    setItemVisible(f, false);
                    fragments.put(index, f);
                } else {
                    Log.w(TAG, "Bad fragment at key " + key);
                }
            }
        }
    }
}
 
Example 12
Project: boohee_v5.6   File: NotificationCompat.java   View Source Code Vote up 5 votes
private static Notification[] getNotificationArrayFromBundle(Bundle bundle, String key) {
    Parcelable[] array = bundle.getParcelableArray(key);
    if ((array instanceof Notification[]) || array == null) {
        return (Notification[]) array;
    }
    Notification[] typedArray = new Notification[array.length];
    for (int i = 0; i < array.length; i++) {
        typedArray[i] = (Notification) array[i];
    }
    bundle.putParcelableArray(key, typedArray);
    return typedArray;
}
 
Example 13
Project: RetroMusicPlayer   File: CustomFragmentStatePagerAdapter.java   View Source Code Vote up 5 votes
@Override
public void restoreState(Parcelable state, ClassLoader loader) {
    if (state != null) {
        Bundle bundle = (Bundle) state;
        bundle.setClassLoader(loader);
        Parcelable[] fss = bundle.getParcelableArray("states");
        mSavedState.clear();
        mFragments.clear();
        if (fss != null) {
            for (int i = 0; i < fss.length; i++) {
                mSavedState.add((Fragment.SavedState) fss[i]);
            }
        }
        Iterable<String> keys = bundle.keySet();
        for (String key : keys) {
            if (key.startsWith("f")) {
                int index = Integer.parseInt(key.substring(1));
                Fragment f = mFragmentManager.getFragment(bundle, key);
                if (f != null) {
                    while (mFragments.size() <= index) {
                        mFragments.add(null);
                    }
                    f.setMenuVisibility(false);
                    mFragments.set(index, f);
                } else {
                    Log.w(TAG, "Bad fragment at key " + key);
                }
            }
        }
    }
}
 
Example 14
Project: GitHub   File: Injector.java   View Source Code Vote up 4 votes
public Parcelable[] getParcelableArray(Bundle state, String key) {
    return state.getParcelableArray(key + baseKey);
}
 
Example 15
Project: android-state   File: InjectionHelper.java   View Source Code Vote up 4 votes
public Parcelable[] getParcelableArray(Bundle state, String key) {
    return state.getParcelableArray(key + mBaseKey);
}
 
Example 16
Project: TPlayer   File: ChooseTypeAndAccountActivity.java   View Source Code Vote up 4 votes
@Override
public void onCreate(Bundle savedInstanceState) {
    // save some items we use frequently
    final Intent intent = getIntent();

    if (savedInstanceState != null) {
        mPendingRequest = savedInstanceState.getInt(KEY_INSTANCE_STATE_PENDING_REQUEST);
        mExistingAccounts =
                savedInstanceState.getParcelableArray(KEY_INSTANCE_STATE_EXISTING_ACCOUNTS);

        // Makes sure that any user selection is preserved across orientation changes.
        mSelectedAccountName = savedInstanceState.getString(
                KEY_INSTANCE_STATE_SELECTED_ACCOUNT_NAME);

        mSelectedAddNewAccount = savedInstanceState.getBoolean(
                KEY_INSTANCE_STATE_SELECTED_ADD_ACCOUNT, false);
        mAccounts = savedInstanceState.getParcelableArrayList(KEY_INSTANCE_STATE_ACCOUNT_LIST);
        mCallingUserId = savedInstanceState.getInt(KEY_USER_ID);
    } else {
        mPendingRequest = REQUEST_NULL;
        mExistingAccounts = null;
        mCallingUserId = intent.getIntExtra(KEY_USER_ID, -1);
        // If the selected account as specified in the intent matches one in the list we will
        // show is as pre-selected.
        Account selectedAccount = intent.getParcelableExtra(EXTRA_SELECTED_ACCOUNT);
        if (selectedAccount != null) {
            mSelectedAccountName = selectedAccount.name;
        }
    }
    VLog.v(TAG, "selected account name is " + mSelectedAccountName);

    mSetOfAllowableAccounts = getAllowableAccountSet(intent);
    mSetOfRelevantAccountTypes = getReleventAccountTypes(intent);
    mDescriptionOverride = intent.getStringExtra(EXTRA_DESCRIPTION_TEXT_OVERRIDE);

    mAccounts = getAcceptableAccountChoices(VAccountManager.get());

    if (mDontShowPicker) {
        super.onCreate(savedInstanceState);
        return;
    }

    // In cases where the activity does not need to show an account picker, cut the chase
    // and return the result directly. Eg:
    // Single account -> select it directly
    // No account -> launch add account activity directly
    if (mPendingRequest == REQUEST_NULL) {
        // If there are no relevant accounts and only one relevant account type go directly to
        // add account. Otherwise let the user choose.
        if (mAccounts.isEmpty()) {
            setNonLabelThemeAndCallSuperCreate(savedInstanceState);
            if (mSetOfRelevantAccountTypes.size() == 1) {
                runAddAccountForAuthenticator(mSetOfRelevantAccountTypes.iterator().next());
            } else {
                startChooseAccountTypeActivity();
            }
        }
    }

    String[] listItems = getListOfDisplayableOptions(mAccounts);
    mSelectedItemIndex = getItemIndexToSelect(
            mAccounts, mSelectedAccountName, mSelectedAddNewAccount);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.choose_type_and_account);
    overrideDescriptionIfSupplied(mDescriptionOverride);
    populateUIAccountList(listItems);

    // Only enable "OK" button if something has been selected.
    mOkButton = (Button) findViewById(android.R.id.button2);
    mOkButton.setEnabled(mSelectedItemIndex != SELECTED_ITEM_NONE);
}
 
Example 17
Project: Android-app   File: MainActivity.java   View Source Code Vote up 4 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    if(savedInstanceState != null)
        videos = (MovieObservableResult[]) savedInstanceState.getParcelableArray(VIDEOS_KEY);

    //Dagger
    ((TgbApp) getApplication()).getAppComponent().inject(this);

    //Butter knife
    ButterKnife.bind(this);

    //Toolbar
    setSupportActionBar(toolbar);

    //Gallery adapter
    WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
    Display display = wm.getDefaultDisplay();

    screenDimensions = new Point();
    display.getSize(screenDimensions);

    mAdapter = new GalleryAdapter(
            this,
            screenDimensions,
            getResources().getConfiguration().orientation
    );

    //Recycler view grid
    RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(getApplicationContext(),
            getResources().getInteger(R.integer.gallery_columns));

    appbarParams = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();

    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new SpacesItemDecoration(5));
    recyclerView.setAdapter(mAdapter);

    swipeRefreshLayout.setOnRefreshListener(() -> {
        videos = null;
        loadingDialog.show(view -> refresh());
    });

    refresh();
}
 
Example 18
Project: Android-app   File: DiscoverActivity.java   View Source Code Vote up 4 votes
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //TODO: Carousel item, subtitle on 2.7inch

    setContentView(R.layout.activity_discover);

    if(savedInstanceState != null)
    {
        try{
            videos = (MovieObservableResult[]) savedInstanceState.getParcelableArray(VIDEOS_KEY);
        }
        catch (Exception e){
            e.printStackTrace();

            finish();
            return;
        }
    }

    //Dagger
    ((TgbApp) getApplication()).getAppComponent().inject(this);

    //Butter knife
    ButterKnife.bind(this);

    //Toolbar
    setSupportActionBar(toolbar);

    //Adapters
    WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
    Display display = wm.getDefaultDisplay();

    //Lists & Maps
    this.videosByGenre = new HashMap<>();

    screenDimensions = new Point();
    display.getSize(screenDimensions);

    mAdapter = new DiscoverAdapter(
            this,
            getResources().getConfiguration().orientation,
            screenDimensions
    );

    //Recycler view grid
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext(),
            LinearLayoutManager.VERTICAL, false);

    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new SpacesItemDecoration(5));
    recyclerView.setAdapter(mAdapter);

    //UI
    appbarParams = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();

    swipeRefreshLayout.setOnRefreshListener(() -> {
        videos = null;
        loadingDialog.show(view -> refresh());
    });

    refresh();
}
 
Example 19
Project: Veggietizer   File: OverviewActivity.java   View Source Code Vote up 4 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_overview);
    FontManager.getInstance().cacheFont(this, FontManager.Font.ROBOTO_LIGHT);

    PreferencesAccess.storeDate(this, PreferencesAccess.NOTIFICATION_PREFS,
            PreferencesAccess.KEY_DATE_LAST_APP_LAUNCH, Calendar.getInstance().getTime());
    cancelNotificationAlarm();

    Utility.setFont(FontManager.Font.ROBOTO_LIGHT, new TextView[]
            {((TextView) findViewById(R.id.textView_overview_heading))});
    Utility.styleActionBar(getSupportActionBar(), FontManager.Font.ROBOTO_LIGHT,
            getResources().getString(R.string.app_name));

    if (savedInstanceState == null) {
        isAchievementOpen = false;
        isStartGuideOpen = false;
        isUpdateNotifierOpen = false;
        isInstantFeedbackOpen = false;
        wasInstantFeedbackShown = false;
        wereAllAchievementsShown = false;
        wasUpdateNotifierShown = false;
        wasStartGuideShown = false;
        achievementsToShow = null;
    } else {
        Parcelable[] achievements = savedInstanceState.getParcelableArray(KEY_ALL_ACHIEVEMENTS);
        Achievement[] achievementsConverted = achievements == null ? null
                : Arrays.copyOf(achievements, achievements.length, Achievement[].class);

        isAchievementOpen = savedInstanceState.getBoolean(KEY_ACHIEVEMENT_OPEN);
        isStartGuideOpen = savedInstanceState.getBoolean(KEY_START_GUIDE_OPEN);
        isUpdateNotifierOpen = savedInstanceState.getBoolean(KEY_UPDATE_NOTIFIER_OPEN);
        isInstantFeedbackOpen = savedInstanceState.getBoolean(KEY_INSTANT_FEEDBACK_OPEN);
        wasInstantFeedbackShown = savedInstanceState.getBoolean(KEY_INSTANT_FEEDBACK_SHOWN);
        wereAllAchievementsShown = savedInstanceState.getBoolean(KEY_ALL_ACHIEVEMENTS_SHOWN);
        wasStartGuideShown = savedInstanceState.getBoolean(KEY_START_GUIDE_SHOWN);
        wasUpdateNotifierShown = savedInstanceState.getBoolean(KEY_UPDATE_NOTIFIER_SHOWN);
        achievementsToShow = achievements == null ? null
            : new ArrayList<>(Arrays.asList(achievementsConverted));

        // Restores the context for each achievement.
        if (achievementsToShow != null) {
            for (Achievement a : achievementsToShow) {
                a.setContext(getApplicationContext());
            }
        }
    }

    Intent intent = getIntent();
    float meatSaved = (float) getIntent().getIntExtra(ViewConstants.MEAT_SAVED, 0);
    float carbonSaved = (float) intent.getIntExtra(ViewConstants.CARBON_SAVED, 0) / 1000.0F;
    float waterSaved = (float) intent.getIntExtra(ViewConstants.WATER_SAVED, 0) / 1.0F;
    float feedSaved = (float) intent.getIntExtra(ViewConstants.FEED_SAVED, 0) / 1000.0F;

    if (meatSaved > 0 && !wasInstantFeedbackShown) {
        showInstantFeedback(meatSaved, carbonSaved, waterSaved, feedSaved);
    }

    isInitialised = false;
}
 
Example 20
Project: Android_watch_magpie   File: ListValuesFragment.java   View Source Code Vote up 4 votes
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getArguments() != null) {
        type = Type.valueOf(getArguments().getString(ARG_TYPE));
    }

    Log.i(TAG, "onCreate() from " + type);

    if (savedInstanceState == null) {
        switch (type) {
            case GLUCOSE:
            case WEIGHT:
                valueAdapter = new SingleValueAdapter();
                break;
            case BLOOD_PRESSURE:
                valueAdapter = new DoubleValueAdapter();
                break;
        }
    } else {
        if (savedInstanceState.getParcelableArray(BUNDLE_KEY) != null) {
            Value[] values = (Value[]) savedInstanceState.getParcelableArray(BUNDLE_KEY);
            List<Value> valuesList = new ArrayList<>();
            for (int i = 0; i < values.length; i++) {
                valuesList.add(values[i]);
            }
            switch (type) {
                case GLUCOSE:
                case WEIGHT:
                    valueAdapter = new SingleValueAdapter(valuesList);
                    break;
                case BLOOD_PRESSURE:
                    valueAdapter = new DoubleValueAdapter(valuesList);
                    break;
            }
        }
    }

    valueDAO = new ValueDAO(getActivity());
    valueDAO.open();
    if (valueAdapter.getCount() == 0) {
        valueAdapter.addAllItems(valueDAO.getAllValues(type));
    }
    setListAdapter(valueAdapter);

    setHasOptionsMenu(true);
}