Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import org.json.JSONObject;

import org.json.JSONObject;
import android.text.TextUtils;

public class Main {
    public static float getFloat(JSONObject jsonObject, String key) {
        if (jsonObject == null || TextUtils.isEmpty(key)) {
            return -1F;
        }
        try {
            return (float) jsonObject.getDouble(key);
        } catch (Exception e) {
        }
        return -1F;
    }
}