好了,所以我在的onCreate和的onResume开始活动执行onResume?
@Override
public void onResume()
{ // After a pause OR at startup
super.onResume();
Intent intent = getIntent();
String name2 = intent.getStringExtra(MyAdapter.KEY_VNAME);
if (name2 == null){
name2 = intent.getStringExtra(MainVoterView.KEY_VNAME2);
}
String Simage = intent.getStringExtra(MyAdapter.KEY_SUGGEST_IMAGE);
if (Simage == null){
Simage = intent.getStringExtra(MainVoterView.KEY_SUGGEST_IMAGE2);
}
layoutManager = new LinearLayoutManager(Suggestion.this);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setHasFixedSize(true);
suggestList = new ArrayList<>();
requestQueue = Volley.newRequestQueue(Suggestion.this);
getData();
adapter = new SuggestListAdapter(suggestList, Suggestion.this, name2, Simage);
recyclerView.setAdapter(adapter);
}
这段代码当我开始我的建议饲料加倍活动..当我暂停应用程序,然后恢复它。建议Feed已修复。我想问的是onResume在开始活动时激活。
如果是的我应该使用什么方法?
如果每次调用Activity执行onResume时,他们为什么会将其称为onResume。对于我所知道的,这并没有恢复。
请大家赐教
【活动生命周期(http://www.tutorialspoint.com/android/android_acitivities.htm) – anaxin