Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/207.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
打开新活动时显示后退按钮-Android_Android - Fatal编程技术网

打开新活动时显示后退按钮-Android

打开新活动时显示后退按钮-Android,android,Android,嘿,伙计们,我有一个由achartengine生成的图表,从中返回一个intent,并在主源代码中启动。当我启动Intent时,它会打开条形图,但它会打开并替换所有其他内容。我已尝试在该活动中显示我的清除按钮,但我遇到了问题 所以我的问题是,当我开始一个新的活动时,如何显示一个按钮并赋予它属性 大卫 更新:源代码: 以下是调用特定函数后函数内的调用: /************ * define new object with BarGraph c

嘿,伙计们,我有一个由
achartengine
生成的图表,从中返回一个
intent
,并在主源代码中启动。当我启动
Intent
时,它会打开条形图,但它会打开并替换所有其他内容。我已尝试在该活动中显示我的
清除按钮
,但我遇到了问题

所以我的问题是,当我开始一个新的活动时,如何显示一个按钮并赋予它属性

大卫

更新:源代码:

以下是调用特定函数后函数内的调用:

            /************
            * define new object with BarGraph class to get results and than display with the bar graph
            ************/
       BarGraph bar = new BarGraph();
            /***********
             * create intent with the results
            ************/
       Intent barIntent = bar.getIntent(this, results);
            /***********
             * start the activity from results
            ***********/
       startActivity(barIntent);
以下是条形图来源:

……包括

public class BarGraph {

    public Intent getIntent(Context context, double [] imgResults){

        double y[] = imgResults;  // store results from processed image {25,10,15,20};

        CategorySeries series = new CategorySeries("Pass levels (80% or lower is a fail)");
        for(int i=0; i < y.length; i++){
            series.add("Bar"+(i+1),y[i]);
        }

        ....chart functions.......
     Intent intent = ChartFactory.getBarChartIntent(context, dataSet, mRenderer,Type.DEFAULT);

                return intent;
    }
}
公共类条形图{
公共意图getIntent(上下文上下文,双[]imgResults){
double y[]=imgResults;//存储处理图像{25,10,15,20}的结果;
CategorySeries系列=新的CategorySeries(“通过级别(80%或更低为失败)”);
对于(int i=0;i
这将返回在我的主要源代码中启动它的图表意图。我在设置相应的按钮时遇到了困难


建议和想法?

如果另一个活动取代了您的活动,那么您为什么需要屏幕上的“后退”按钮?你可以很容易地按手机的“后退”按钮返回。我希望用户能够查看两种不同的结果表单,一种是条形图,另一种是回击,能够看到更简单的表单,但也能够继续前进。在条形图活动中添加按钮有什么问题?“我希望用户能够查看两种不同的结果表单,一种是条形图,另一种是回击,能够看到更简单的表单,但也能够再次向前移动“--那为什么这不是两个标签呢?或者只是使用设备自己的后退按钮?@DavidBiga Android需要在系统导航栏中设置后退按钮(如果没有硬件按钮)。除非这是一个自定义ROM。