检测应用程序是否还活着的最佳/更安全的方法是将位置发送到主活动(如果应用程序处于活动状态或在后台运行)还是后端(如果应用程序被杀死)?public void onLocationChanged(Location location) {
//To transfer the data to the main activityI use broadcast receiver in the main activity, using a
我有两个活动和一个数据库。我所要做的就是当我按下活动A中的一个按钮时,我将editText中的字符串发送给活动B。在活动B中,我尝试将该字符串插入到我的数据库中,并将其显示在列表视图中。如果我在活动A中启动活动B,则所有操作都有效,但不会显示活动B。下面是我的代码:public class Example extends Activity {
public final static