• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps how to use the Settings menu button?

Ristar

Lurker
API 10

/res/menu/main_app.xml
Code:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/menu_settings"
        android:title="@string/menu_settings"
        android:onClick="showSettingsMenu"
        android:orderInCategory="100" />
</menu>

/src/com.my_app/MainActivity.java
Code:
public void showSettingsMenu(View view){
    setContentView(R.layout.settings_main);
}

im supposed to go to the settings screen after pressing the menu button on the phone and pressing on the "Settings" option.

but it isnt happening. wat am i doing wrong?

pls help.
 
To create your own settings? You must start your activity/fragment, not set content view.

Good Luck!
Darkwispr

thanks for your reply... but im not sure wat u meant. can u please elaborate?

i have to start one more Activity... so, i cant just use "class MainActivity extends Activity"?

which method do i need to use to display the settings screen other than setContentView()? do u know of any examples?

thanks.
 
Back
Top Bottom