Comments (6)
Sorry I don't understand what you mean by that. The pages are just defined by XML attributes, all it really is, is a Fragment. So yes, you can put whatever UI elements you want, into it.
from android-floatingtutorialactivity.
Hello,
Like that :
Can I send to result activity the two elements ?
Thanks
from android-floatingtutorialactivity.
Yes, it is just a normal intent that you are returning to the calling activity. It works the same way as any other activity that provides a result.
from android-floatingtutorialactivity.
yes but means I must do in onclicklistener on my ratingBar ? and on addTextChangedListener for the EditText ?
like :
findViewById<BaseRatingBar>(R.id.rating).setOnRatingChangeListener { baseRatingBar: BaseRatingBar, fl: Float ->
val resultData = Intent()
resultData.putExtra(RESULT_DATA_STARS, fl)
setResult(Activity.RESULT_OK, resultData)
}
findViewById<AppCompatEditText>(R.id.editComment).addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(p0: Editable?) {
val resultData = Intent()
resultData.putExtra(RESULT_DATA_COMMENT, p0.toString())
setResult(Activity.RESULT_OK, resultData)
}
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
}
override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
}
})
Thanks
from android-floatingtutorialactivity.
You can only set the result once, and you need to include both pieces of data in the intent. I think that you should look up some information on getting the result from the activity. My library does not do it any differently than a generic Android Activity
. It uses the exact same system.
https://developer.android.com/training/basics/intents/result
val resultData = Intent()
resultData.putExtra(RESULT_DATA_STARS, stars)
resultData.putExtra(RESULT_DATA_COMMENT, editComment.text.toString())
setResult(Activity.RESULT_OK, resultData)
from android-floatingtutorialactivity.
strenge that when I do in the my post works I retreive all the two element ...
from android-floatingtutorialactivity.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-floatingtutorialactivity.