2016-05-10 50 views
2

我在Android的新的,我已經在Java代碼不能解析符號getCheckedRadioButtonId

cannot resolve symbol 'getCheckedRadioButtonId' 

這個問題這個代碼

Bind(R.id.radioGroup) RadioGroup _radioGroup; 

    if (_radioGroup.getCheckedRadioButtonId() != -1) 
    { 

    } 

沒有收到getCheckedRadioButtonId。我想查看RadioButton中的文字。我該怎麼做呢 ?

+0

返回所選擇的單選按鈕的id這個組中,以便測試會像 如果(_radioGroup.getCheckedRadioButtonId()!= R.id.myBox) –

+0

是否使用'ButterKnife'? –

+0

是的,我使用Butterknife –

回答

0
apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.3" 

    defaultConfig { 
     applicationId "com.example.elhez.tammeni" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.3.0' 
    compile 'com.android.support:design:23.3.0' 
    compile 'com.jakewharton:butterknife:7.0.1' 

    compile 'com.google.android.gms:play-services-appindexing:8.1.0' 
}