I'm already with thousands of tabs opened here trying to figure out why my application doesn't work. I created a NavigationDrawer application on Eclipse, and now I'm editing it according to my needs. What I'm thinking about doing is, when the user press any drawer options, it then loads another screen. Seems basic, but just can't make this work.
I'm overwriting the method created by this template: onNavigationDrawerItemSelected, which describes the action that is executed when any option is clicked. By default, it changes the name of the upper thing (forgot the name) by the name specified in the option. Here is where i want to make another screen appear. So, after this renaming, i've tried a lot of things:
FrameLayout item = (FrameLayout)findViewById(R.layout.activity_main); LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.fragment_main, item, false); item.addView(view);RelativeLayout screen = (RelativeLayout)findViewById(R.layout.fragment_main); screen.setVisibility(View.VISIBLE);setContentView(findViewById(R.layout.fragment_main));Intent intent = new Intent(this, InputData.class); startActivity(intent);- By creating another class that pops up the layout
Does anyone have an idea of why it's not working? I just want to show another screen :'(
No comments:
Post a Comment