Example usage for android.content.res Resources getStringArray

List of usage examples for android.content.res Resources getStringArray

Introduction

In this page you can find the example usage for android.content.res Resources getStringArray.

Prototype

@NonNull
public String[] getStringArray(@ArrayRes int id) throws NotFoundException 

Source Link

Document

Return the string array associated with a particular resource ID.

Usage

From source file:radoslav.yordanov.quizgames.adapter.TopScoresViewPagerAdapter.java

public TopScoresViewPagerAdapter(FragmentManager fm, Resources res) {
    super(fm);
    navMenuTitles = res.getStringArray(R.array.topScoresTabs);
}

From source file:info.curtbinder.reefangel.phone.NotificationListCursorAdapter.java

public NotificationListCursorAdapter(Context context, Cursor c, int flags) {
    super(context, c, flags);
    final Resources r = context.getResources();
    deviceParameters = r.getStringArray(R.array.deviceParameters);
    notifyConditions = r.getStringArray(R.array.notifyConditions);
}

From source file:pl.reticular.br.dialogs.SegmentNumberDialog.java

@NonNull
@Override//from w  w  w.ja v  a 2  s.  c  o m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    // Use the Builder class for convenient dialog construction
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

    builder.setTitle(R.string.segment_number)
            .setItems(R.array.segment_numbers, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    Resources res = getContext().getResources();
                    String str = res.getStringArray(R.array.segment_numbers)[which];
                    int val = Integer.parseInt(str);
                    PrefsHelper.getInstance().setSegmentNumber(val);
                }
            }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                }
            });

    return builder.create();
}

From source file:com.angelo.demo.fragment.MainFragment.java

private List<Fragment> createPagerFragments() {
    List<Fragment> dataList = new LinkedList<Fragment>();
    final Resources res = getActivity().getResources();
    final String[] dataArr = res.getStringArray(R.array.view_pager_data);

    for (final String dataStr : dataArr) {
        TemplateFragment fragment = new TemplateFragment();
        fragment.setTitle(dataStr);/*from  w ww .j  a  v  a 2  s . c om*/
        dataList.add(fragment);
    }

    return dataList;
}

From source file:loonyb.in.posmachine.InvoiceFragment.java

private TableRow itemsHeader() {
    Context c = getActivity();/*from w ww  . jav a  2s .  com*/
    Resources res = getResources();
    String[] headers = res.getStringArray(R.array.item_header);

    TableRow row = new TableRow(c);

    for (int i = 0; i < headers.length; i++) {
        TextView column = new TextView(c);
        column.setText(headers[i]);
        row.addView(column);
    }

    return row;
}

From source file:com.coco.mystickers.ui.ImageGridActivity.java

public void loadItems() {
    // load menus titles
    Resources resources = getResources();
    menus = resources.getStringArray(R.array.menu_array);
}

From source file:tw.com.geminihsu.app01.fragment.Fragment_Support.java

private void findViews() {
    listView = (ListView) getView().findViewById(R.id.listView1);

    listView.setVisibility(View.VISIBLE);

    Resources res = getResources();
    String[] menu = res.getStringArray(R.array.support_menu);
    final ArrayList<String> list = new ArrayList<String>();
    for (int i = 0; i < menu.length; ++i) {
        list.add(menu[i]);/*from  w  w  w . j  av a  2  s . c o m*/
    }
    ListAdapter adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_list_item_1, menu);
    //ListAdapter

    listView.setAdapter(adapter);

}

From source file:com.vrem.wifianalyzer.wifi.graphutils.GraphColors.java

private List<GraphColor> getAvailableGraphColors() {
    if (availableGraphColors.isEmpty()) {
        Resources resources = MainContext.INSTANCE.getMainActivity().getResources();
        String[] colorsAsStrings = resources.getStringArray(R.array.graph_colors);
        for (int i = 0; i < colorsAsStrings.length; i += 2) {
            GraphColor graphColor = new GraphColor(Long.parseLong(colorsAsStrings[i].substring(1), 16),
                    Long.parseLong(colorsAsStrings[i + 1].substring(1), 16));
            availableGraphColors.add(graphColor);
        }//from  ww w  .  j av  a 2 s. com
    }
    return availableGraphColors;
}

From source file:com.seneca.android.senefit.exlist.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_exlist);

    exercises = new LinkedHashSet<Exercise>();
    db = new DbHelper(this);

    Resources r = getResources();
    String[] items = r.getStringArray(R.array.exercise_array);

    lv = (ListView) findViewById(R.id.listView);
    //custAdapter cus = new custAdapter(this,items);
    // ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,names);
    // lv.setAdapter(adapter);
    new GetFitt().execute();

}

From source file:com.fuzz.emptyhusk.MainActivity.java

@NonNull
private SimplePagerAdapter defineAdapter(@NonNull Resources resources) {
    String[] pages = resources.getStringArray(R.array.introductory_messages);
    return new SimplePagerAdapter(pages);
}