I have some public variables define in my activity class:
public class RentListingFeed extends ActionBarActivity {
private ParseQueryAdapter<ParseObject> mainAdapter;
private CustomAdapter rexovoAdapter;
private ListView listView;
public String typeQuery;
public String bedQuery;
public String toiletQuery;
public String condQuery;
public String availQuery;
public String intentionQuery;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_rent_listing_feed);
typeQuery=getIntent().getStringExtra("Type");
bedQuery=getIntent().getStringExtra("Beds");
toiletQuery=getIntent().getStringExtra("Toilets");
condQuery=getIntent().getStringExtra("Condition");
availQuery=getIntent().getStringExtra("Availability");
intentionQuery=getIntent().getStringExtra("Intention");
As you can see, these variable are getting their values from some activity.
How can I access these variable in a separate class?
My separate class:
public class CustomAdapter extends ParseQueryAdapter<ParseObject> {
public CustomAdapter(Context context) {
// Use the QueryFactory to construct a PQA that will only show
// Todos marked as high-pri
super(context, new QueryFactory<ParseObject>() {
public ParseQuery create() {
ParseQuery query = new ParseQuery("PropertyDetails");
query.whereEqualTo("Tag", "Property");
query.whereEqualTo("Type","");
return query;
}
});
}
In this class, I have to assign these variables to :
query.whereEqualTo("Type","");
How can I do that?
Thanks and Regards
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…