将从服务器获取的数据传递给 Android 意图(intent)该如何实现?

huangapple go评论57阅读模式
英文:

how pass data fetched from server to intent in android?

问题

我必须将从服务器获取的数据传递给ACTION_DIAL意图。那么我该如何将这些数据传递给意图?

以下是我的适配器类代码:

intent.putExtra("datafromserver", dataFromS);

我该如何处理从服务器获取的数据并将其传递给意图?

英文:

I have to pass data fetched from server to ACTION_DIAL intent. So how could I pass that data to the intent?

Below is my adapter class code:

intent.putExtra,("datafromserver", dataFromS);

How can I handle the fetched from the server and pass this data to the intent?

答案1

得分: 3

手机号码来自JSON的地方应该是你接收到的电话号码,

Intent intent = new Intent(Intent.ACTION_DIAL, Uri.fromParts("tel", "+91 1166008855", null));
startActivity(intent);
英文:

The place where the mobile number is where your received phone number from JSON should be,

Intent intent = new Intent(Intent.ACTION_DIAL, Uri.fromParts("tel", "+91 1166008855", null));
            startActivity(intent);

huangapple
  • 本文由 发表于 2020年1月3日 16:34:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/59575363.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定