Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/190.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_Android Intent - Fatal编程技术网

Android 我想把我从以前的活动中得到的文本设置为意图?

Android 我想把我从以前的活动中得到的文本设置为意图?,android,android-intent,Android,Android Intent,/我的意图有问题,无法设置我从上一个活动获取的getIntent中获取的text/更改此项: /*I have problem with intent that i can't settext which i have got from getIntent from previous activity*/ public class Done extends Activity { @Override protected void onCreat

/我的意图有问题,无法设置我从上一个活动获取的getIntent中获取的text/

更改此项:

   /*I have problem with intent that i can't settext which i have got from getIntent from previous activity*/ 


    public class Done extends Activity {

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_done);
            TextView text = (TextView)findViewById(R.id.donetxt);
            int tappedapples=0;
            RelativeLayout rl = (RelativeLayout)findViewById(R.id.RelativeLayout);
            rl.setBackgroundResource(R.drawable.background);
            /*I want to setText which i have got from previous activity*/
            Bundle extras = getIntent().getExtras();
            if(extras!=null){
                int apples = extras.getInt("tappedapples",0);
                text.setText(Integer.parseInt("tappedapples"));
             }
        }
    }
致:


雅皮士正在工作,我想画出用户在结果中收集到的对象activity@donfuxx+1谢谢你的精彩回答。如果我想为我的应用程序制作教程,怎么做?你的应用程序制作教程是什么意思@用户3248914是否可以截屏视频并上传到youtube?
int apples = extras.getInt("tappedapples",0);
text.setText(Integer.parseInt("tappedapples"));
int apples = extras.getInt("tappedapples",0);
text.setText(apples+"");