get Long Value from EditText - Android User Interface

Android examples for User Interface:EditText

Description

get Long Value from EditText

Demo Code


//package com.java2s;

import android.text.TextUtils;
import android.widget.EditText;

public class Main {
    public static long getLongValue(EditText editText) {

        return editText == null || TextUtils.isEmpty(editText.getText()) ? 0
                : Long.parseLong(editText.getText().toString());
    }/*from  www .  ja va2s .co  m*/
}

Related Tutorials