get Input String From View - Android User Interface

Android examples for User Interface:Spinner

Description

get Input String From View

Demo Code


//package com.java2s;

import android.widget.EditText;
import android.widget.Spinner;

public class Main {
    public static String getInputStringFromView(EditText editText) {
        return editText.getText().toString().trim();
    }/*from   w  w  w . j a v a  2s.  c  om*/

    public static String getInputStringFromView(Spinner spinner) {
        return spinner.getSelectedItem().toString().trim();
    }
}

Related Tutorials