We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
主要思路,通过intent.putExtra(String key,String value);实现内存中传值 关于value使用map变量和ArrayList和json(Gson库)处理 创建布局界面里使用
map.put("text","按钮"); map.put("width",-2); intent.putExtras("layout"),newGson().toJson(ArrayList<map> views)) intent.setClass(Context,sub.class) startActivity(intent)
接收端
layout = new Gson().fromJson(getIntent().getStringExtra("layout") //遍历所有ArrayList<map> 就是获取每一个map元素 //再从每一个map元素中取值(根据key) //然后动态创建view,动态设置属性,最后添加到布局中去
The text was updated successfully, but these errors were encountered:
ArrayList相当于大数组(存储每一个view对象的数据),map对象可以存放多个key(作为一个view对象(自身)的数据容器存储)。
Sorry, something went wrong.
2439905184
No branches or pull requests
主要思路,通过intent.putExtra(String key,String value);实现内存中传值
关于value使用map变量和ArrayList和json(Gson库)处理
创建布局界面里使用
接收端
The text was updated successfully, but these errors were encountered: