MyWay
MyWay

Reputation: 1025

adding other library crashes other one

I try to add facebookSDK library to my project and everything crashed. Firstly appear the problem that I have 3 version of android-support-v4.jar, so I copied the file from my project and paste it in other 2 direction. Then I get the problem with the action bar buttons like something wrong was with these library, I remove all files and add it one more time.

Now I have error in every single case

public boolean onOptionsItemSelected(MenuItem item)
{ 
    Intent  intent;
    switch (item.getItemId())
    {
 here ->    case R.id.Choice1:
        intent= new Intent(this, Chooser.class);

        startActivity(intent);

        return true;

like he didn't see the items from menu. I have to add android-support-v4.jar one more time ?

Upvotes: 0

Views: 33

Answers (1)

null pointer
null pointer

Reputation: 5914

replace the switch/case statement with if/else. You can just click on switch and then press CTRL+1 if you're in Eclipse.

check this question for more info switch case statement error: case expressions must be constant expression

Upvotes: 1

Related Questions