1
public void firstMethod(){
//has code intiates another activity and method (thirdMethod) where an id is retrieved
}
acitivity2:
public void thirdMethod(){
//has code that does query for an id and stores it as a variable
}
活动1:
public void secondMethod(){
//has code that displays the variable from thirdMethod
}
我试图做的是设置数据库调用(活性1)变量,检索一个id /执行数据库调用(activity2),将结果存储为变量(activity2),然后显示在原始活动(活动1)中
问题是:它先采用方法,第二种方法,第三种方法而不是第一种方法,第三种方法,第二种方法使变量为空。
似乎在活动中实际的数据库调用之前1层的方法来完成所有活动2.
什么我需要做的,以确保第一和第三方法显示变量之前做了什么?