为什么我们使用此代码请任何人告诉我

时间:2017-03-22 06:43:56

标签: android

submitButtonLayout =(LinearLayout)findViewById(R.id.submit_button_layout);

public void drawPath(String  result) {

try {
        //Tranform the string into a json object
       final JSONObject json = new JSONObject(result);
       JSONArray routeArray = json.getJSONArray("routes");
       JSONObject routes = routeArray.getJSONObject(0);
       JSONObject overviewPolylines = routes.getJSONObject("overview_polyline");
       String encodedString = overviewPolylines.getString("points");
       List<LatLng> list = decodePoly(encodedString);
       Polyline line = mMap.addPolyline(new PolylineOptions()
                                .addAll(list)
                                .width(12)
                                .color(Color.parseColor("#05b1fb"))//Google maps blue color
                                .geodesic(true)
                );

} 
catch (JSONException e) {

}
}    

1 个答案:

答案 0 :(得分:0)

https://developer.android.com/training/permissions/requesting.html

Beginning in Android 6.0 (API level 23), 
users grant permissions to apps while the app is running,
not when they install the app.
This approach streamlines the app install process,
since the user does not need to grant permissions when they install or update the app.
It also gives the user more control over the app's functionality; 
for example, a user could choose to give a camera app access to the camera but not to the device location.
The user can revoke the permissions at any time, by going to the app's Settings screen.

您需要的基本概述。浏览链接以获取有关实施和其他限制的更多详细信息。