Когда я пытаюсь сделать снимок экрана своей активности, которая использует Androidplot, я получаю сообщение «Could'nt capture capture screenshot - storage может использоваться». Я могу сделать снимок экрана отлично, если график Androidplot не помещен в действие.Androidplot не смог захватить снимок экрана
private void renderAndroidPlot()
{
// on ICS+ devices :-)
getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE);
// initialize our XYPlot reference:
plot = (XYPlot) getView().findViewById(R.id.mySimpleXYPlot);
// Create a couple arrays of y-values to plot:
Number[] series1Numbers = getGraphData();
// Turn the above arrays into XYSeries':
XYSeries series1 = new SimpleXYSeries(
Arrays.asList(series1Numbers), // SimpleXYSeries takes a List so turn our array into a List
SimpleXYSeries.ArrayFormat.XY_VALS_INTERLEAVED, // Y_VALS_ONLY means use the element index as the x value
"Series1"); // Set the display title of the series
// add a new series' to the xyplot:
plot.getGraphWidget().getGridBackgroundPaint().setColor(Color.WHITE);
plot.getGraphWidget().getBackgroundPaint().setColor(Color.WHITE);
plot.setBorderStyle(Plot.BorderStyle.NONE, null, null);
Paint lineFill = new Paint();
lineFill.setAlpha(200);
lineFill.setShader(new LinearGradient(0, 0, 0, 250, Color.WHITE, Color.parseColor("#99E6B1"), Shader.TileMode.MIRROR));
LineAndPointFormatter formatter = new LineAndPointFormatter(Color.rgb(0, 0,0), null, null,null);
formatter.setFillPaint(lineFill);
plot.setPlotMargins(0, 0, 0, 0);
plot.setPlotPadding(0, 0, 0, 0);
plot.getGraphWidget().setMarginTop(30);
plot.getGraphWidget().setMarginRight(50);
plot.getGraphWidget().setMarginLeft(50);
plot.getGraphWidget().setMarginBottom(50);
plot.getGraphWidget().getDomainLabelPaint().setColor(Color.BLACK);
plot.getGraphWidget().getRangeLabelPaint().setColor(Color.BLACK);
plot.getGraphWidget().getDomainOriginLabelPaint().setColor(Color.BLACK);
plot.getGraphWidget().getDomainOriginLinePaint().setColor(Color.BLACK);
plot.getGraphWidget().getRangeOriginLinePaint().setColor(Color.BLACK);
// reduce the number of range labels
plot.setTicksPerRangeLabel(3);
plot.getGraphWidget().setDomainLabelOrientation(0);
//Remove legend
plot.getLayoutManager().remove(plot.getLegendWidget());
//plot.getLayoutManager().remove(plot.getDomainLabelWidget());
plot.getLayoutManager().remove(plot.getRangeLabelWidget());
plot.getLayoutManager().remove(plot.getTitleWidget());
plot.setDomainStep(XYStepMode.SUBDIVIDE, 6);
plot.addSeries(series1, formatter); //new LineAndPointFormatter(Color.parseColor("#2E64FE"), null, null, null));
}
Может ли у вас некоторая привязка к фрагменту кода? – keshav
только что обновили мой основной запрос кодом - спасибо. – user3792936