我想知道如何从 a 传递或获取值Toast
,以便我可以在我的TextView
.
编辑
这部分 mycode 正在服务中
public void onStart(Intent i, int stID){
super.onStart(i, stID);
Toast.makeText(getApplicationContext(), "Horas", Toast.LENGTH_LONG).show();
}
以下代码是我的主要活动的一部分
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//this code to call the service
startService(new Intent (this, MyService.class));
}
所以我可以在我的服务或我的主要活动中添加什么,让我可以在 textview 中获取和显示消息有人可以帮我解决这个问题吗?