简体   繁体   English

如何在不按后退按钮和关闭按钮的情况下将数据从第二个活动传递到第一个(弹出窗口)?

[英]How to pass data from 2nd activity to 1st (Popup) without press back button and close button?

I want to call data of activity using popup.我想使用弹出窗口调用活动数据。 Let me explain in brief... when i click on EditText of a dialog box让我简要解释一下......当我点击对话框的 EditText 时对话框

when i click on EditText (Template) then it will open activity.当我单击 EditText(模板)时,它将打开活动。 活动,当我点击 EditText(Template)

after i select one option and activity will finish and selected option's value will be set in EditText of Template.在 i select 之后,一个选项和活动将完成,所选选项的值将在模板的 EditText 中设置。

Why not use a Button (perhaps with a drawable) instead of an EditText?为什么不使用 Button(可能带有可绘制对象)而不是 EditText? This makes more sense because the user won't be typing anything into the EditText.这更有意义,因为用户不会在 EditText 中键入任何内容。

As for passing the data back and forth, just use startActivityForResult() .至于来回传递数据,只需使用 startActivityForResult() 即可

选择模板前

选择模板后

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 按下后如何将数据从第二个活动传递到第一个活动? - android - How to pass data from 2nd activity to 1st activity when pressed back? - android 如何从第二活动到第一活动获取数据 - How to get data from 2nd Activity to 1st Activity 将第1个活动的值传递给android中的第2个活动 - Pass the value from 1st activity to 2nd activity in android 在不丢失更新数据的情况下将第二个活动的价值保存到第一个活动 - Saving value from 2nd activity to 1st without losing the updated data 如何保存从第一个活动传递到第二个活动的意图数据 - how to save intent data passed from 1st activity to 2nd activity 第一项活动第二项活动获得纬度经度地理位置。 如何将信息转移回第一活动? - 1st activity 2nd activity to get the latitude longitude geo-location. How to transfer info back to 1st activity? 从第一个活动转到第二个活动时出错 - error when going from 1st activity to 2nd activity 当我返回到第一个活动时,第二个活动未调用第二个活动的onCreate()函数 - When I return back to 1st Activity the onCreate() function of 2nd Activity is not called in 2nd time Android:从第二项活动切换回第一项会同时退出 - Android: Switching from 2nd activity back to 1st quits both 如何在第一个活动中调用第二个活动值? - how to call 2nd activity value in 1st activity?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM