android.content.Intent#getDoubleArrayExtra ( )源码实例Demo

下面列出了android.content.Intent#getDoubleArrayExtra ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: WiFi-RTT-Trilateration   文件: MainActivity.java
@Override
public void onReceive(Context context, Intent intent)
{
    if (intent.getAction().equals(Constants.SERVICE_COMMS.MESSAGE))
    {
        //  Debug / info message
        showMessage(intent.getStringExtra(Constants.SERVICE_COMMS.MESSAGE), false);
    }
    else if (intent.getAction().equals(Constants.SERVICE_COMMS.LOCATION_COORDS))
    {
        //  double[] of current coordinates
        double[] centroid = intent.getDoubleArrayExtra(Constants.SERVICE_COMMS.LOCATION_COORDS);
        String sCentroid = "Trilateration (centroid): ";
        for (int i = 0; i < centroid.length; i++)
            sCentroid += "" + (int)centroid[i] + ", ";
        showMessage(sCentroid, true);
    }
    else if (intent.getAction().equals(Constants.SERVICE_COMMS.FINISH))
    {
        finishAffinity();
    }
}
 
源代码2 项目: WiFi-RTT-Trilateration   文件: MapActivity.java
@Override
public void onReceive(Context context, Intent intent)
{
    if (intent.getAction().equals(Constants.SERVICE_COMMS.LOCATION_COORDS))
    {
        //  double[] of current coordinates
        double[] centroid = intent.getDoubleArrayExtra(Constants.SERVICE_COMMS.LOCATION_COORDS);
        //  todo currently hardcoded for 2D
        movePin(centroid[0], centroid[1], 0.0);
    }
    else if (intent.getAction().equals(Constants.SERVICE_COMMS.FINISH))
    {
        finishAffinity();
    }
}
 
源代码3 项目: commcare-android   文件: GeoPointMapActivity.java
private void loadViewModeState() {
    Intent intent = getIntent();
    if (intent != null && intent.getExtras() != null) {
        double[] location = intent.getDoubleArrayExtra(GeoPointWidget.LOCATION);
        this.location.setLatitude(location[0]);
        this.location.setLongitude(location[1]);
        this.location.setAltitude(location[2]);
        this.location.setAccuracy((float)location[3]);
        isManualSelectedLocation = true;
        inViewMode = intent.getBooleanExtra(EXTRA_VIEW_ONLY, false);
    }
}
 
源代码4 项目: geopaparazzi   文件: GpsServiceUtilities.java
/**
 * Utility to get the position from an intent.
 *
 * @param intent the intent.
 * @return the position as lon, lat, elev.
 */
public static double[] getPosition(Intent intent) {
    if (intent == null) {
        return null;
    }
    double[] position = intent.getDoubleArrayExtra(GPS_SERVICE_POSITION);
    return position;
}
 
源代码5 项目: WiFi-RTT-Trilateration   文件: MapActivity.java
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    double[] currentLocation = intent.getDoubleArrayExtra("location");
    movePin(currentLocation[0], currentLocation[1], 0.0);
}
 
源代码6 项目: Ticket-Analysis   文件: IntentUtil.java
public static double[] getDoubleArrayExtra(Intent intent, String name) {
    if (!hasIntent(intent) || !hasExtra(intent, name)) return null;
    return intent.getDoubleArrayExtra(name);
}
 
 方法所在类
 同类方法