首页
学习
活动
专区
圈层
工具
发布
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    2014-10-25Android学习--------activity之间批量传递数据----Bundle类的实现

    ().getExtras(); // 解析得到的值 int drawable=bundle.getInt("drawable"); String foodname=bundle.getString...().getExtras(); //getIntent()能够得到activity传递过来的意图(Intent) 对象,然后调用getExtras()函数,我们能得到传递过来的批量数据,注意了,这个数据它是继承...Activity.getIntent() // 这个能很好的让我们明白getIntent()的返回值时什么,谁来调用它 Bundle android . content ....Intent .getExtras()//这个能很好的让我们明白getExtras()的返回值是什么,谁来调用 下面我们就需要对Bundle类进行分析了, 我们看下文档中是如何介绍...().getExtras()来生成一个bundle对象 其次取数据,利用bundle.get(String key)来获取传递过来的值 接下来在分析其他的代码了: image = (Button)

    90520

    AndroidUI高级之十六使用Intent进行通信

    要激活一个新的Activity,或者让一个现有的Activity做新的操作,可以通过调用Context.startActivity()或者Activity.startActivityForResult(...)方法,要启动一个新的Service,或者向一个已有的Service传递新的指令,调用Context.startService()方法或者调用Context.bindService()方法将调用此方法的上下文对象与...Android匹配Intent无关 •Intent提供了多个相对的get……方法和set……方法用于读写数据 •当传入到组件中时,通过Bundle的getExtras...SettingActivity.class); it.putExtra(“username”, “root”); startActivity(it); 在被启动的组件中,可以通过getIntent...方法获得Intent对象 Intent it = getIntent(); String username = it.getExtras().getString(“username

    63110
    领券