Aug 13, 2023 13:28
Thanks :-)
Aug 13, 2023 13:27
However, I've reached to the exact point of my problem I've described it more precisely here, can you please take a look stackoverflow.com/questions/76893566/…
Aug 13, 2023 13:27
I understood why that much of byte code is being generated, Thanks for clarification.
Aug 13, 2023 13:26
Hi @broot
Aug 11, 2023 17:31
public final class DummyServiceWrapper {
@Nullable
public final Object foo(@NotNull Continuation var1) {
Object $continuation;
label20: {
if (var1 instanceof <undefinedtype>) {
$continuation = (<undefinedtype>)var1;
if ((((<undefinedtype>)$continuation).label & Integer.MIN_VALUE) != 0) {
((<undefinedtype>)$continuation).label -= Integer.MIN_VALUE;
break label20;
}
}

$continuation = new ContinuationImpl(var1) {
// $FF: synthetic field
Object result;
int label;

@Nullable
public final Object invokeSuspend(@NotNull Object $result) {
Aug 11, 2023 17:31
The generated byte code looks like below
Aug 11, 2023 17:30
import com.example.reply.test.StringWrapper
import kotlinx.coroutines.delay

class DummyPrinter{

suspend fun printHello(){
delay(1000L)
println("Hey there")
}


suspend fun printHello1(): StringWrapper {
delay(1000L)
println("Hey there")
return StringWrapper("hello")
}
}
Aug 11, 2023 17:30
class DummyServiceWrapper {


suspend fun foo() {
delay(1000L)
print("hey there")
}

suspend fun bar() {
val p = DummyPrinter()
p.printHello()
}

suspend fun baz() {
val p = DummyPrinter()
p.printHello1()
}

}
Aug 11, 2023 17:30
Agree, but can you please try below
Aug 11, 2023 16:00
I have added one more update to the question, for more clarity on the question or rather I should say the issue, can you please check and let me know if you got an understanding of what I am trying to say.
Aug 11, 2023 15:41
the code sample I provided is a sample code to demonstrate the issue
Aug 11, 2023 06:40
I have added UPDATE 1 check that, there are two suspending method, and their bytecode, if you observe, they differ by far and large. @broot
Aug 11, 2023 06:39
have you verified the same?
Aug 11, 2023 06:39
I want you to understand that StingWrapper being an inline class, will be replaced by the String type, except for the constructor call. The issue that I am trying to explain is that when I use it inside a suspending method/function, the continuation object is created again in that function.
Aug 11, 2023 06:39
Are you saying that this -> suspend fun fetchString() { delay(1000L) StringWrapper("Testing") } and suspend fun fetchString() { delay(1000L) "Testing" } are producing the same byte code?
Aug 11, 2023 06:39
Nope, if neither the function/method signature nor the definition does not contain any inline class being involved then it would be pretty simple and as expected. @broot
Aug 11, 2023 06:39
@broot can you please check the question now, I have added one more plain suspending method, and its byte code, the issue is in the case of plain and suspending calls it generates bytecode the way expected, however when I just add a line of code that contains an inline class type then it goes mad.
 
Feb 2, 2021 04:28
in your viewpager adapter try to keep the fragment instances in a map or list, recreation of a fragment is an expensive operation, There other things in the fragment also executed.
Feb 2, 2021 04:24
please check out the best practices recommended by Google @medium, medium.com/androiddevelopers/…
Feb 1, 2021 20:05
and in the original code are you doing some thing in onstart or on resume?
Feb 1, 2021 20:04
ok
Feb 1, 2021 20:03
observers() who is this guy?
Feb 1, 2021 20:00
yes but original
Feb 1, 2021 20:00
If you could give the original code especially of the oncreate()
Feb 1, 2021 19:59
Hey, you gave the changed code
Feb 1, 2021 19:59
If you can add the code, you can be helped
Feb 1, 2021 19:59
can you add AppActivity's code
Feb 1, 2021 19:59
Well then, now you don't need that?
 
Jan 19, 2021 15:27
do what @saeedata said remove text alignment use gravity property only
Jan 19, 2021 15:26
@saeedata Yes
Jan 19, 2021 15:25
but your xml says that the gravity is set to start
Jan 19, 2021 15:22
from the code, I can say that the content text is coming at the start, but the username and author name are coming at center, right?
Jan 19, 2021 15:18
?
Jan 19, 2021 15:16
the item not matching the width of device or text are at start?
Jan 19, 2021 15:15
what is the issue exactly?
Jan 19, 2021 15:12
this issue coming in emulator?
Jan 19, 2021 15:12
Have you tested in other devices?
 
Jan 16, 2021 17:18
All the best
Jan 16, 2021 17:17
which you can convert to kotlin by studio
Jan 16, 2021 17:17
then jsonschema2pojo.org this will help you to generate a java pojo
Jan 16, 2021 17:16
see the json above ask the person at api to send in this form
Jan 16, 2021 17:16
no need
Jan 16, 2021 17:16
seee above
Jan 16, 2021 17:16
Then the sample of json is for you
Jan 16, 2021 17:15
you want a list of Quotes?
Jan 16, 2021 17:14
yes
Jan 16, 2021 17:14
{ "success": true, "terms": "currencylayer.com/terms", "privacy": "currencylayer.com/privacy", "timestamp": 1610813346, "source": "USD", "quotes": [ { "name":"USDAED", "value":3.673042 }, { "name":"USDAED", "value":3.673042 } ] }
Jan 16, 2021 17:14
your api gives a single object in response not a list
Jan 16, 2021 17:14
you want a list of Quotes then ask the person at the API end to send json array of Quotes instead of one object
 
Jan 12, 2021 09:57
I just did it this way.