我在我的应用程序崩溃或循环在我的Android应用程序之一,扩展活动,我使用onResume()刷新从PreferenceActivity返回活动,这种方式...如果我使用onResume()方法
public class ListViewWebShort extends Activity {
ListView listView;
@Override
protected void onResume() {
super.onResume();
this.onCreate(null);
}
....
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list_view);
// Get ListView object from xml
listView = (ListView) findViewById(R.id.list);
....
..在这里,应用程序工作正常。
在另一应用程序,其中,I延伸AppCompatActivity,相同的onResume()方法,使我的应用程序崩溃或环上开始:
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
ListView listView;
ArrayAdapter<String> adapter;
....
@Override
protected void onResume() {
super.onResume();
this.onCreate(null);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
....
如果使用requestWindowFeature(Window.FEATURE_NO_TITLE);以前的setContentView,我看到在调试该应用程序中的循环getDelegate()的setContentView(layoutResID),里面AppCompactActivity.java,但如果我删除它,在同一个函数的应用功能界别。 这真的让我疯狂......我错过了什么?
先感谢您的任何建议。
为什么不使用没有操作栏的主题而不使用NoTitle? –
@KarunShrestha,但我确实想要动作吧.. – gabolander