Wrong View Option Menu

90 views Asked by At

I followed the steps to create option menu in Android project following this link Here

But after applying it to my project instead of option menu appearing Vertically (4 rows ), it appeared Horizontally ( 4 Items divided by 2 Rows ) What could be the problem here is my code

@Override
        public boolean onOptionsItemSelected(MenuItem item)
        {
              switch (item.getItemId()) {
              case R.id.Settings:
                        // write code to execute when clicked on this option
                  Intent nextScreen3 = new Intent(getApplicationContext(), FirstSSettings.class);
                    startActivity(nextScreen3);
                         return true;   

              case R.id.Verify:
                         // write code to execute when clicked on this option
                        Intent nextScreen4 = new Intent(getApplicationContext(), Verify.class);
                        startActivity(nextScreen4);
                         return true;

               case R.id.callInfo:
                //   startActivity(new Intent().setClass(MainActivity.this, LoginActivity.class).setData(getIntent().getData()));                        // write code to execute when clicked on this option
                                              return true;

              case R.id.email:
                                             // write code to execute when clicked on this option
                                               return true;

                default:
                                    return super.onOptionsItemSelected(item);
          }
      }
1

There are 1 answers

0
Victor KP On

Check which version of android you are targeting in your AndroidManifest.xml

It has to be equal or above Honeycomb's API version (11). Ideally you'll be targeting the latest version of Android (KitKat is 19).

See the line in your manifest that is

<uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="19" />

And make sure that targetSdkVersion is at least 11.