【发布时间】:2018-05-31 08:54:35
【问题描述】:
不确定这是否可行,但我正在尝试从 CustomerCall 活动向 RiderHome 活动发送敬酒消息。
一旦司机选择取消。需要向 RiderHome 活动发送祝酒词“司机已取消请求”
这个可以吗?
客户电话
btnCancel = (Button)findViewById(R.id.btnDecline);
btnCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
cancelBooking();
}
});
}
private void cancelBooking() {
Intent intent = new Intent(getBaseContext(), RiderHome.class);
String cancel = "cancel"
intent.putExtra("cancel", cancel);
startActivity(intent);
Toast.makeText(CustomerCall.this, "The Driver has cancelled
the request", Toast.LENGTH_LONG).show();
}
RiderHome
public class RiderHome extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener, OnMapReadyCallback,
GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener,
LocationListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
}
}
【问题讨论】:
-
您如何浏览 RiderHome 活动?您能否使用 Intent 包含您的代码 sn-p?
-
您为什么不干杯 CustomerCall 活动?如果您只是要敬酒,为什么需要将敬酒/消息从另一个活动传递到另一个活动?
-
@TentenPonce 一旦驱动取消请求,需要向 Rider 发送请求被取消的消息
-
您是指在其他手机/应用程序上吗?或者这只是一个应用程序,因为根据您的标题,从活动到活动。
-
@TentenPonce。我有一个应用程序,您可以在其中以驾驶员或骑手的身份登录。如果用户是 Driver 而另一部手机上的用户是 Rider ...
标签: android android-intent android-toast