Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.widget.ArrayAdapter;

import java.util.List;

public class Main {
    public static void fillRightList(String[] pairsList, List<String> namesList, ArrayAdapter<String> adapter,
            String targetPair) {
        String[] componentsList;
        String targetName = targetPair.split("-")[0];
        if (targetPair.length() != 0) {
            namesList.clear();
            for (String s : pairsList) {
                componentsList = s.split("-");
                if (componentsList[0].equals(targetName)) {
                    namesList.add(componentsList[1]);
                }
            }
            if (adapter != null) {
                adapter.notifyDataSetChanged();
            }
        }
    }
}