Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.widget.Spinner;

public class Main {
    public static int GetIndexSpinner(Spinner spinner, Object myfind) {

        int index = 0;

        for (int i = 0; i < spinner.getCount(); i++) {
            if (spinner.getItemAtPosition(i).equals(myfind)) {
                index = i;
            }
        }
        return index;
    }
}